Re: [PHP] Passwords?

2005-03-09 Thread Jochem Maas
Chris W. Parker wrote:
Jochem Maas 
on Sunday, March 06, 2005 5:24 AM said:

that said you still don't want this file or this string to get into
the hands of evilhaxors - best to keep this file (one with the
encrypted pwd in it) outside of the docroot.

Why encode it at all then?
If someone is smart/crafty enough to actually hack the server and gain
access to the file which contains the password you're trying to protect
is the least of your problems.
a, make it as hard as possible. do everything you can to make the hack 
harder.
b, a webmaster may have perms to admin the server but maybe should not have
access to the 'app' via its interface as a 'super user'
c, it allows you to send a hash of the password over the wire (rather than
not encrypting or encrypting the password on the server) and check that.
d, it sets the bar just high enough (for my clients at least) that nobody
will attempt to try and change the passwd. if it was plaintext then you could
just replace it, if its a hash then you have to generate a hash in order to
replace the 'super user' pwd.
but yes, if someone 'owns' you box then you have bigger problems :-)

Chris.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: sorting arrays

2005-03-09 Thread Jochem Maas
Brian A. Anderson wrote:
RTFM
arsort()

Ok, so I use asort(), and I don't get the result I wanted. Instead I get the
script telling me my foreach loop is wrong on the second test round, as if
it did something other than simply sort the array. It seems that I can't
access the array now?

$nar = array('lma-bg51' => 1, 'mcr-vh14' => 2, 'gmc-rr21' => 5, 'amh-fg23'
=> 1);
foreach( $nar AS $key => $val ) {
 echo "$key: $val";
}
$nar = asort($nar);
^--- WTF is the name of this var?
foreach( $nar2 AS $key => $val ) {
 ^--- WTF is the name of this var?
 echo "$key: $val";
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Pop-up message

2005-03-09 Thread Jochem Maas
Lester Caine wrote:
At the risk of being shouted at because *I* know it's not a PHP problem!
I have a page that is being refreshed every 30 seconds or so, and 
displays a list of 'tickets' waiting to be dealt with on a list from a 
database query. No problems there, but a couple of sites now want me to 
add a pop-up warning when a ticket is added that has a staff ID matching 
the logged in user.

I can drive a sounder in the target browser, but need kicking in the 
right direction for a method of adding a pop-up window. Ideally it needs 
to be browser agnostic, which is where the problem comes given the 
pop-up blockers and other 'toys' that are being added to the browser end 
of things.

So can anybody point me in the right direction for a CURRENT method of 
achieving this, many of the bits I've found so far are somewhat 
antiquated, and fail in one way or another :(
I don't know about 'CURRENT' but you have atleast 3 options:
1. if its an intranet app then just tell them they have to add the intranet 
server
to a trusted zone (and that the browser should allow popups
2. dump your popup info in an absolutely positioned div and make the layer
visible on top of the rest of the page (with a js link that hides the layer 
again)
3. use a js alert(), which you might consider ugly... BUT its modal, its not 
blockable
(other than if js is turned off completely!) -- a user is therefore forced to 
read the
alert and click OK in order to continue.
if you want to do something that is triggered by page onload() then you can use 
this
function to add the handler to the document.onload event without breaking any 
other
js code (functions) which have already been 'attached' to the onload event:
function joinFunctions()
{
var newfunc = '';
for (var c = 0;c < arguments.length;c++) {
if ( arguments[c] ) {
var func=arguments[c].toString();
newfunc+=func.substr(func.indexOf("{")-1);
}
}
return new Function(newfunc);
}
example:
window.onload = joinFunctions(
window.onload,
function() { alert('Hey User you have been assigned some new 
tickets!'); }
);


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySQL - PHP - limits...

2005-03-09 Thread Marek Kilimajer
Alex Ortiz wrote:
Hello.
Is there a records limit when browsing (a sql SELECT) in PHP from a MySQL 
table?
no limit on php side, perhaps 2^31 if you do calculations.
I´m browsing a table with PHP from MySQL, and something is wrong, if the 
table has more than 5047 records, the browse appears blank. Additionaly, if 
make the browse in a child window (target="_blank"), the limit becomes 
lower: 437 records.

My SQL query is:
SELECT * FROM my_table ORDER BY my_order_index
The way I "solve" the problem is adding LIMIT 5047 to query (or 437), just 
for testing. This works fine.
Echo out your sql query and see if you get what you should.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [Fwd: [PHP-DEV] Simple idea for ERP - please help]

2005-03-09 Thread Jochem Maas
anyone fancy spoonfeeding this guy your lifes work?
talk about a snowballs chance in hell of getting help!
Morty, if you read this:
bugging internals with this kind of request will most probably earn
your mail a place at /dev/null. Besides which your first 'stage'
consists of a complete groupware,mail,document-management system,
people on mailing lists are not here to design, build and implement
complete systems for you! And why bother asking the developers of php
if they think php is a bad choice to build an 'intranet' app with
- I can just hear Zeev/Andi/Rasmus/Wez/A.N.Other harking "PHP
totally sucks for web development, I recommend writing it in C#/.NET" ??
 Original Message 
To: internals@lists.php.net
From: morty <[EMAIL PROTECTED]>
Date: Wed, 09 Mar 2005 10:37:43 +0100
Subject: [PHP-DEV] Simple idea for ERP - please help
Heloo
I'm starting project.First stage is for my school work, but i want to
develop it to the end.
I want to create a ERP based on php for small company's
I want to use as many as possible created opensource applications.
First i need to choose some framework, maybye someone think that php is
not a good idea..I'm waiting for propositions:)
I need to add to this framework some graphic database manager. If it
possible for all databases, but I did't found any ..I want to start with
postgres and mysql., maybye firebird.
Second I have to add soe functionality witch is needed for company
worker, mayby webmail,small cms for documents...
I also need to add sometching for making automatic
documentation.(phpdocumentor ?)
Thats the first stage.I need it in  the short time :(
Second i will be developing modules for all departments in small and
medium company.
More details on the webpage(i'm designing it ) and next posts..
Anyone please help in the first stage...I really don't have much time.
Morty...
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie LEFT JOIN question

2005-03-09 Thread Jackson Linux
First, I apologize - I'm new to this, grateful for the list and just 
confused. I didn't mean to post improperly.

Second, thanks so much Rory for simplifying it and answering that 
anyway.  I promise I wasn't going for technical impressiveness and 
easier is definitely better!

Thanks again,
Jack
On 9 Mar 2005, at 02:19, Rory McKinley wrote:
Jackson Linux wrote:
Hi, all,
I have three tables; 'cv', the main table, 'jobcat', a definition 
table and 'cvjobcats',  an intersection table (for more detail see PS 
below).
I'd like to join this all together to be able to make a headline 
consisting of the plain English description of the job category 
followed by all rows within cv which contain a reference to that job 
category
I can follow this only to a point and that is where I ask for the 
List's help - does this even resemble the beginnings of what I want 
to accomplish? I've tried to comment as I go for my own sanity
//Select columns from 'cv', whose 'category' references numbers
//Select 'category' from 'jobcat' to translate the numbers to English
"SELECT cv.cv_id,
 cv.category,
dates,
cv.job_title,
cv.company,
cv.job,
 jobcat.category
FROM cv
LEFT JOIN cvjobcats
 ON cvjobcats.cv=cv.cv_id //Let tables cv and jobcat understand each 
other.
//This next bit I'm confused about
LEFT JOIN jobcat
 ON jobcat.jobcat_id=cvjobcats.jobcat
WHERE
 cvjobcats.jobcat='4'";
Great. I'm now lost. Can anyone advise?
Thanks in advance,
PS:
 
cv contains columns including an primary key ('cv_id') and a column 
called 'category' which refers to job categories by number.
jobcat contains two fields: a primary key (jobcat_id) and a plain 
english description
cvjobcat contains two key columns: 'cv_id' and 'jobcat_id'.

Hello Jackson
Are there any circumstances under which the cvjobcats table would have 
a job category entry that does not appear in the jobcats table? IF 
not, you really don't need to use the LEFT JOINS. Instead you coudl do 
something like this:

SELECT cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job, 
jobcat.category
FROM cv, cvjobcats, jobcats
WHERE cvjobcats.cv=cv.cv_id AND cvjobcats_jobcat = 4 AND 
jobcat.jobcat_id=cvjobcats.jobcat

Less technically impressive perhaps but easier to follow ;)
Regards
Rory

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] openBase

2005-03-09 Thread François-Xavier Lacroix
Do anybody ever use php to access 'open base' ?
--
François-Xavier LACROIX - http://www.clever-age.com
Clever Age - conseil en architecture technique
Tél: +33 1 53 34 66 10  Fax: +33 1 53 34 65 20
Clever Age lance son blog de veille permanente
  http://www.clever-age.com/veille/weblog/ 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie LEFT JOIN question

2005-03-09 Thread John Nichel
Jackson Linux wrote:

http://lists.mysql.com/
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP5.0.3 and pam authentication

2005-03-09 Thread Jason Barnett
Chris Dion wrote:
> I'm trying to use pam_auth for a script.  It loads into php but it's not
> authenticating the users.  I'm using the correct password and username.
> This is a example of how I'm using the function:
>
> pam_auth($_POST[uname], $_POST[passwd], &$error)
>
> Any ideas? Thanks in advance

Listen, I don't have the foggiest idea what pam_auth() does.  Maybe it's
some PHP code that you have... but I have never seen it.  So unless you
actually provide us with a little code here 99.9% of us are going to be
clueless about what your function is doing...

Other than that your question is a good one... so please, just ask it
again, but this time give us an idea of what pam_auth() is doing.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


RE: [PHP] suspicious - maybe spam

2005-03-09 Thread Christo van Rooyen
Same here 


Christo van Rooyen 


-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
Sent: 08 March 2005 19:58
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: Kevin; PHP General Mail List
Subject: RE: [PHP] suspicious - maybe spam

Richard Lynch 
on Tuesday, March 08, 2005 9:54 AM said:

> Don't feel too bad.
> 
> Every few weeks, I get an automated email from ezmlm warning me that 
> php-general messages have bounced, and I might be removed from the 
> list if it keeps up.

Same here.

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP5.0.3 and pam authentication

2005-03-09 Thread Jochem Maas
Jason Barnett wrote:
Chris Dion wrote:
I'm trying to use pam_auth for a script.  It loads into php but it's not
authenticating the users.  I'm using the correct password and username.
you have verified that by doing?:
print_r($_POST);
and you can confirm that you can authenticate against PAM via
another means (outside of php) with those same credentials?
have you followed all the steps mentioned here?:
http://www.math.ohio-state.edu/~ccunning/pam_auth/INSTALL

This is a example of how I'm using the function:
pam_auth($_POST[uname], $_POST[passwd], &$error)
in the mean time...
do: $_POST['uname']
and not:$_POST[uname]
not that that will fix your problem!
and seeing as you are using php5 the '&' sign preceeding the $error var
is not really cool either - the function should define that its passed by 
reference,
call-time-pass-by-reference (or whatever the  its officially called) is
depreciated.
Any ideas? Thanks in advance

Listen, I don't have the foggiest idea what pam_auth() does.  Maybe it's
ditto :-)
some PHP code that you have... but I have never seen it.  So unless you
actually provide us with a little code here 99.9% of us are going to be
clueless about what your function is doing...
Other than that your question is a good one... so please, just ask it
again, but this time give us an idea of what pam_auth() is doing.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [Fwd: [PHP-DEV] Simple idea for ERP - please help]

2005-03-09 Thread Jason Barnett
Jochem Maas wrote:
> anyone fancy spoonfeeding this guy your lifes work?

No not really.  Then again PHP isn't my life's work :)

>
> talk about a snowballs chance in hell of getting help!
>
> Morty, if you read this:
> bugging internals with this kind of request will most probably earn
> your mail a place at /dev/null. Besides which your first 'stage'

Agreed... he chose a poor, poor way to go about getting help.  Morty if
you're now reading *this* message be sure to check out the first link in
my signature as it is clear that you are a newbie.

> consists of a complete groupware,mail,document-management system,
> people on mailing lists are not here to design, build and implement
> complete systems for you! And why bother asking the developers of php
> if they think php is a bad choice to build an 'intranet' app with
> - I can just hear Zeev/Andi/Rasmus/Wez/A.N.Other harking "PHP
> totally sucks for web development, I recommend writing it in C#/.NET" ??
>

Also agreed... although he probably didn't intend it to come out that
way, it was quite a rude question to ask.

All of this being said: believe it or not there actually *are* some open
source ERP apps out there.  I even know of one that is written in PHP.
While it looks quite promising it is nowhere near completion.  Perhaps
if Morty is truly interested in an open source ERP app he might decide
to help out that project?

Details to possibly follow...

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


[PHP] Internal Server Error ?!?

2005-03-09 Thread [EMAIL PROTECTED]
Hi guys.
Last night I got "Internal Server Error" on every page written in php. 
HTML pages work just fine.
Our web site is on dedicated server. I contacted tech and he said they 
didn't touch the server and must be something I did.
I REALLY don't remember I did anything wrong. Just regular php coding. 
And, everything was working fine while I was in my office. I found this 
problem at home.
What could cause this problem? Any hint?

Thanks!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] software catalog

2005-03-09 Thread Ryan A
Hey,
Thanks for replying.

Searching for shopping cart php gives me hundreds of results, mostly carts
for tangible items.
I was hoping someone could recommend a solution that they have used as since
nearly all of us work for other people or make software to sell...this must
be pretty common.

Drop me a line if you remember what that cart was, and thanks again for
replying.

Cheers,
Ryan

On 3/8/2005 10:55:45 PM, Chris W. Parker ([EMAIL PROTECTED]) wrote:
> Try searching for "shopping cart php". I'm *pretty* sure I've seen a cart
> made specifically for selling software but I
> couldn't find it when I searched soo I don't know.
>
>
>
>
>
> -Original Message-
>
> From: Ryan A [mailto:[EMAIL PROTECTED]
>
> Sent: Wed 3/9/2005 6:21 AM
>
> To: php
>
> Cc:
>
> Subject: [PHP] software catalog
>
> Hey!
>
> Anybody know of a "software catalog" (or cart preferably) that is free?
>
>
>
> A site i am working for sells software,



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Internal Server Error ?!?

2005-03-09 Thread John Nichel
[EMAIL PROTECTED] wrote:
Hi guys.
Last night I got "Internal Server Error" on every page written in php. 
HTML pages work just fine.
Our web site is on dedicated server. I contacted tech and he said they 
didn't touch the server and must be something I did.
I REALLY don't remember I did anything wrong. Just regular php coding. 
And, everything was working fine while I was in my office. I found this 
problem at home.
What could cause this problem? Any hint?
Look at your error logs.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] software catalog

2005-03-09 Thread Ryan A
Hey!
Thanks for replying.

Hot scripts and script search ware the two places which i checked out first
before writing to the list, then google, because I dont need a jackass who
has been on the list for 2 days telling me to f***ing google for it, just
coz it would make him feel happy with himself :-)

I dont want to build this from scratch as I am sure there must be quite a
few out there, i'm just surprised that nobody has recommended one that they
used or heard about other than Chris (from this same list)

A very basic cart would do but searching for shopping cart php gives me
hundreds of results, its really hard sorting through all that trying to find
one that caters to just software selling.
I have not checked SF as yet, thanks for the tip, will hit that immd after
this email.

In the meantime if anything comes to mind please drop me a line.

Thanks,
Ryan


On 3/8/2005 9:12:58 PM, James Williams ([EMAIL PROTECTED]) wrote:
> What's up Ryan, I do believe that the cart software you choose should
> for the most part be independent upon what exactly your selling.  There
> are a few big shopping cart solutions that work for selling anything and
> I'm
> sure there are features and / or plugins that will allow you to do
>
> discounts based on multiple product purchases.  hit up sourceforge or
>
> hot scipts and you're sure to find plenty of awsome results.  Good Luck!
>
> Ryan A wrote:
> > Hey!
> > Anybody know of a "software catalog" (or cart preferably) that is free?
> >
> > A site i am working for sells software, now they want to have a cart
feature
> > so people can put the packages in a cart and get discounts etc if they
> > purchase more than 1 product...they are using 2checkout for processing.
> >
> > I checked the usual places and google of "php software cart" but got
back
> > garbled results, most of that carts are for tangible products :-(
> >
> > Any help or recommendations would be appreciated.
> >
> > Thanks in advance,
> > Ryan
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Internal Server Error ?!?

2005-03-09 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
> Hi guys.
> Last night I got "Internal Server Error" on every page written in php.
> HTML pages work just fine.
> Our web site is on dedicated server. I contacted tech and he said they
> didn't touch the server and must be something I did.
> I REALLY don't remember I did anything wrong. Just regular php coding.
> And, everything was working fine while I was in my office. I found this
> problem at home.
> What could cause this problem? Any hint?

Generally an "Internal Server Error" is caused by server
misconfiguration(s).

Start out by checking your scripts for any ini_set() functions that
might have caused a problem (not likely, but hey give the guy the
benefit of the doubt).

Ask your sysadmin how errors are handled... for example what error code
will the server send when you have E_ERROR in a PHP script?  If the
answer is "Internal Server Error", then check out what you modified last
night and try to find that E_ERROR.

Did you create the PHP files as a different user?  More directly, are
your PHP files readable by PHP?

Did you enable any extensions last night?  Or disable any extensions for
that matter?

Did you touch PHP.ini?

Finally... did he update the PHP installation (new version, new php.ini
file, new apache conf file / changed IIS, anything)?

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Re: Internal Server Error ?!?

2005-03-09 Thread [EMAIL PROTECTED]
Jason Barnett wrote:
[EMAIL PROTECTED] wrote:
 

Hi guys.
Last night I got "Internal Server Error" on every page written in php.
HTML pages work just fine.
Our web site is on dedicated server. I contacted tech and he said they
didn't touch the server and must be something I did.
I REALLY don't remember I did anything wrong. Just regular php coding.
And, everything was working fine while I was in my office. I found this
problem at home.
What could cause this problem? Any hint?
   

Generally an "Internal Server Error" is caused by server
misconfiguration(s).
Start out by checking your scripts for any ini_set() functions that
might have caused a problem (not likely, but hey give the guy the
benefit of the doubt).
 

Didn't use ini_set() function in my code
Ask your sysadmin how errors are handled... for example what error code
will the server send when you have E_ERROR in a PHP script?  If the
answer is "Internal Server Error", then check out what you modified last
night and try to find that E_ERROR.
 

My last work was on simple php coding, more fine tuning.
But, on server we have three shopping carts for three clients (didn't 
work on them for a while), few small sites with registration forms and 
adminstration area, and nothing works? I can't even open phpMyAdmin. 
Getting download window that ask me do I want to Open or Save a the file?

Did you create the PHP files as a different user?  More directly, are
your PHP files readable by PHP?
Did you enable any extensions last night?  Or disable any extensions for
that matter?
 

Nope!
Did you touch PHP.ini?
 

Nope!
Finally... did he update the PHP installation (new version, new php.ini
file, new apache conf file / changed IIS, anything)?
 

They said that didn't touch our server.

--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread tg-php
Yeah, same here.  I thought it was my hosting service, but if other people are 
having the same issue then what's the deal?   Usually it's only a message or 
two, but sometimes it says there are like 8 or 9 messages that bounced.   Has 
anyone looked into this or have any information regarding this?

I was wondering of other emails were bouncing trying to get to me and just 
hadn't taken the time to follow up with my hosting company about it.

-TG

= = = Original message = = =

Same here 


Christo van Rooyen 


-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
Sent: 08 March 2005 19:58
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: Kevin; PHP General Mail List
Subject: RE: [PHP] suspicious - maybe spam

Richard Lynch 
on Tuesday, March 08, 2005 9:54 AM said:

> Don't feel too bad.
> 
> Every few weeks, I get an automated email from ezmlm warning me that 
> php-general messages have bounced, and I might be removed from the 
> list if it keeps up.

Same here.


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Internal Server Error ?!?

2005-03-09 Thread John Nichel
[EMAIL PROTECTED] wrote:
Sound silly but: Where I can find error logs on server?
:)
Reply to the list.
Where are _YOUR_ error logs?  I have no idea.  I don't know what web 
server software you're running, how you installed it, where you 
installed it, etc.

Honestly, if you don't know where your error logs are, you really need 
to RTFM for your web server software.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Newbie Variable Question

2005-03-09 Thread Jackson Linux
Hi, All,
A php variable question.
I've done this to take the requested category from the URL  
(www.foo.com/file.htm?r=1)
and use it to build the page:

if (isset($_GET['r']) && !empty($_GET['r'])) {
$r = "'{$_GET['r']}'"; //Set the variable $r to mean the category number
$fields = '*';
} else {
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

In this case $r comes out literally to the number surrounded by single  
quotes (ie, '1'). And it works great.

But I need *just* the number for something later (to fetch an include  
based on the category selected by $r). Since I've set the value of the  
field cv.category to mean the english translation from the intersecting  
table, using

 asks for  
cv.'1'.include.php ... And I need it to ask for cv.1.include.php

How can I make a variable to fetch the literal number from the field  
cv.category?

Thanks in advance!
Jack
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] a new it company

2005-03-09 Thread shar
Hi members,
 
How are you. I have seen a very good site www.bansalsetech.com, visit this site 
for your Seo / design / programming projects. Great people.

Regards


Re: [PHP] ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread Rob Tanner
Every ezmlm mailing list I'm on does that periodically.  Lists that I'm
on that use MailMan never seem to have that problem.  What then does
that tell us about ezmlm...

--On Wednesday, March 09, 2005 09:53:35 AM -0500
[EMAIL PROTECTED] wrote:

> Yeah, same here.  I thought it was my hosting service, but if other
> people are having the same issue then what's the deal?   Usually it's
> only a message or two, but sometimes it says there are like 8 or 9
> messages that bounced.   Has anyone looked into this or have any
> information regarding this?
> 
> I was wondering of other emails were bouncing trying to get to me and
> just hadn't taken the time to follow up with my hosting company about
> it.
> 
> -TG
> 
> = = = Original message = = =
> 
> Same here 
> 
> 
> Christo van Rooyen 
> 
> 
> -Original Message-
> From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
> Sent: 08 March 2005 19:58
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: Kevin; PHP General Mail List
> Subject: RE: [PHP] suspicious - maybe spam
> 
> Richard Lynch 
> on Tuesday, March 08, 2005 9:54 AM said:
> 
>> Don't feel too bad.
>> 
>> Every few weeks, I get an automated email from ezmlm warning me that 
>> php-general messages have bounced, and I might be removed from the 
>> list if it keeps up.
> 
> Same here.
> 
> 
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.



-- 
Rob Tanner
UNIX Services Manager
Linfield College, McMinnville OR

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.0.3 and base64 encoded cookie value issue?

2005-03-09 Thread Pink Floyd
Greetings,
 I tested Richard's suggestion below, and it appears
that 'urlencode' is not the function that I want.
 Are there any other options? Does anyone know what
PHP uses internally to 'munge' the cookie? I looked at
the php.ini doc's and I could not find any option to
turn off whatever 'encoding' PHP uses internally.

>From the spec, it appears that the encoding of cookie
is recommended but not required. Obviously, our non
php server uses base64 encoding for the cookie. So the
question would be can we plug-in a handler to change
the  decoding for what-ever php uses or even better to
turn it off?

Thanks
MK


--- Pink Floyd <[EMAIL PROTECTED]> wrote:
> Richard,
>   Thanks for clearing that up. I figured the value
> was
> transformed by the parser, but I did not know that
> it
> could be urlencode. I will test it tomorrow and
> confirm that it is so, I tried to look in the manual
> but did not  find it anywhere.
> Thanks a lot.
> MK
> --- Richard Lynch <[EMAIL PROTECTED]> wrote:
> > Pink Floyd wrote:
> > > (I had posted this in the Zend php-general
> mailing
> > > list
> > > but it did not show up in php.net, so here it is
> > > again)
> > > Greetings,
> > > I am not sure whether this is a bug or a
> 'feature'
> > > (new to PHP). I have a cookie that is set by our
> > > password server (NON-PHP) for our domain, whose
> > value
> > > is base64 encoded when set.
> > > Now, when I try to retrieve the Cookie from my
> > > PHP/Apache Web server the $_COOKIE['token']
> value
> > is
> > > messed up. What I have noticed is the '+'
> > character is
> > > being replaced by ' '.
> > > I have the magic_quotes_gpc set to 'off' and
> > > variables_order set to 'gpcs' in my php.ini.
> > > Currently, I have hacked around by painfully
> > parsing
> > > the $_SERVER['HTTP_COOKIE'] variable and
> > extracting
> > > the 'token' cookie, where its value appears to
> be
> > > intact as set by our password server.
> > >
> > > I would like to avoid this hack if possible, is
> > there
> > > a way to retrieve the 'raw' cookie value without
> > php
> > > 'cleansing' it?
> > 
> > There is a raw_headers variable, but it would be
> > even more to parse than
> > what you've got...
> > 
> > It occurs to me, though, that PHP is almost for
> sure
> > using the same
> > under-lying code as http://php.net/urldecode and
> you
> > could just take the
> > cookie value you get and pass it through
> > http://php.net/urlencode to
> > "undo" the decode that PHP did.
> > 
> > They're inverse functions, so it should be safe to
> > do that for any/all
> > munging that gets done, not just "+" <-> " " but
> > also any %XX that happens
> > to occur in your base64-encoded value.
> > 
> > Still a "hack" but far less painful than parsing
> the
> > raw Cookie stuff
> > yourself, and you're less likely to screw up and
> > miss some kind of
> > "gotcha" with % or + or space or...
> > 
> > If there *IS* a way to turn off PHP URL decoding,
> > it's gonna be in php.ini
> > and it's gonna be documented right in there.
> > 
> > PHP doesn't have a bunch of undocumented
> "features"
> > that you rely on to
> > work. :-)
> > 
> > PS It's a feature:
> > [Netscape Cookie spec excerpt]
> > "This string is a sequence of characters excluding
> > semi-colon, comma and
> > white space. If there is a need to place such data
> > in the name or value,
> > some encoding method such as URL style %XX
> encoding
> > is recommended, though
> > no encoding is defined or required."
> > 
> > Since data often *DOES* have white space
> semi-colon
> > or comma (yours
> > doesn't, but that's the exception) then you have
> to
> > do SOME kind of
> > encoding on it.
> > 
> > It's a lot easier to just always
> urlencode/urldecode
> > it than to document
> > and code every chunk of data that might or might
> not
> > have those
> > characters, and then only encode/decode the ones
> > that need it.
> > 
> > base64 encoding is also a fine choice, of course,
> > but it's also easier to
> > handle untrusted data of Cookies, POST, and GET
> all
> > the same, and GET has
> > to be urlencoded, so urlencoding is the choice
> made.
> > 
> > So you basically want to do:
> > $token =
> > base64_decode(urlencode($_COOKIES['token']));
> > and Bob's your uncle.
> > 
> > -- 
> > Like Music?
> > http://l-i-e.com/artists.htm
> > 
> > 
> 
> 
>   
>   
> __ 
> Celebrate Yahoo!'s 10th Birthday! 
> Yahoo! Netrospective: 100 Moments of the Web 
> http://birthday.yahoo.com/netrospective/
> 




__ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] imagedestroy()

2005-03-09 Thread Edward Vermillion
Sorry if this is an old subject but it's new to me. I have a 'default' 
Fedora Core 1 installation of Apache2 v2.0.48 and php v4.3.8. I've 
noticed a problem in one of the scripts i had written a few months ago, 
but I was testing it on a Red Hat 8 system at the time and I'm not sure 
if the memory limit is default on that system or not. Anyway, what I've 
got is a script that is generating thumbnails from a batch of images in 
a directory, about 5000 images are being counted. While the script 
worked fine when i wrote  it a few months ago, on the different system, 
I was recently trying to use it and was repeatedly getting memory limit 
errors at an 8MB limit. What the script does is load an image in 
memory, create three different thumbnail sizes for the image, 
imagedestroy() is being called after each thumbnail build to kill the 
thumb, and then finally I'm calling imagedestroy() at the end of the 
iteration for that image to kill the original in memory before going on 
to the next image. What it appears to me is that imagedestroy() is not 
actually freeing the memory for use on the next cycle. While this 
doesn't really effect the scripts I have that are just generating 
thumbnails from a single image, the batch scripts I have are 
continually failing after about three iterations. I did increase the 
memory limit enough to get the script to finish, and php is apparently 
doing it's job in cleaning up when the script finishes so there's not a 
real threat to the server if I run the scripts during slow times. But 
it is a bit annoying that the function isn't working as it should. I 
noticed a few memory issues in the bugs pages relating to gd, and the 
resolution stated that it was a gd problem,  so I didn't want to bother 
the php maintainers with another one. What I'm wondering is if anyone 
else has noticed this behavior, and aside from increasing the memory 
limit, have you found an alternative? I'm really trying to keep the 
scripts I have portable, so I haven't looked at ImageMagic, but I was 
wondering if the shmop functions might be the way to go with this. I do 
have reservations about using that though since it's not a 'default' in 
the build and I have some servers that I have no control over the 
software side of things, and I am trying to make these as generic as 
possible. If you've gotten this far thanks, sorry it turned out to be 
so long, but this is a rather important problem in what I'm coding.

Edward Vermillion
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Newbie Variable Question

2005-03-09 Thread Jason Barnett
Jackson Linux wrote:
...
>  asks for
> cv.'1'.include.php ... And I need it to ask for cv.1.include.php
>
> How can I make a variable to fetch the literal number from the field
> cv.category?

Not 100% certain that it will work, but try casting the variable $r to
an integer:



>
> Thanks in advance!
> Jack


--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


RE: [PHP] software catalog

2005-03-09 Thread Ariceaga, Luis TQM
Well...
I see in HotScripts that there is a category named "E-Commerce" and
inside there is a sub-category named "Shopping Carts"...
[
http://www.hotscripts.com/PHP/Scripts_and_Programs/E-Commerce/Shopping_C
arts/index.html ]
Good Luck!
/Luis

-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 09, 2005 5:51 PM
To: [EMAIL PROTECTED]
Cc: php
Subject: Re: [PHP] software catalog

Hey!
Thanks for replying.

Hot scripts and script search ware the two places which i checked out
first before writing to the list, then google, because I dont need a
jackass who has been on the list for 2 days telling me to f***ing google
for it, just coz it would make him feel happy with himself :-)

I dont want to build this from scratch as I am sure there must be quite
a few out there, i'm just surprised that nobody has recommended one that
they used or heard about other than Chris (from this same list)

A very basic cart would do but searching for shopping cart php gives me
hundreds of results, its really hard sorting through all that trying to
find one that caters to just software selling.
I have not checked SF as yet, thanks for the tip, will hit that immd
after this email.

In the meantime if anything comes to mind please drop me a line.

Thanks,
Ryan


On 3/8/2005 9:12:58 PM, James Williams ([EMAIL PROTECTED]) wrote:
> What's up Ryan, I do believe that the cart software you choose should 
> for the most part be independent upon what exactly your selling.  
> There are a few big shopping cart solutions that work for selling 
> anything and I'm sure there are features and / or plugins that will 
> allow you to do
>
> discounts based on multiple product purchases.  hit up sourceforge or
>
> hot scipts and you're sure to find plenty of awsome results.  Good
Luck!
>
> Ryan A wrote:
> > Hey!
> > Anybody know of a "software catalog" (or cart preferably) that is
free?
> >
> > A site i am working for sells software, now they want to have a cart
feature
> > so people can put the packages in a cart and get discounts etc if 
> > they purchase more than 1 product...they are using 2checkout for
processing.
> >
> > I checked the usual places and google of "php software cart" but got
back
> > garbled results, most of that carts are for tangible products :-(
> >
> > Any help or recommendations would be appreciated.
> >
> > Thanks in advance,
> > Ryan
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newbie Variable Question

2005-03-09 Thread Jackson Linux
On 9 Mar 2005, at 11:15, Jason Barnett wrote:
Jackson Linux wrote:
...
 asks for
cv.'1'.include.php ... And I need it to ask for cv.1.include.php
How can I make a variable to fetch the literal number from the field
cv.category?
Not 100% certain that it will work, but try casting the variable $r to
an integer:


H. If  only. . .This returns, regardless of input and the value of 
$r

cv.0.include.php'
 For chuckles, I did check and the column is set in the table as INT.  
If that matters.
...?

Jack
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: imagedestroy()

2005-03-09 Thread Jason Barnett
Edward Vermillion wrote:
...
> a directory, about 5000 images are being counted. While the script
> worked fine when i wrote  it a few months ago, on the different system,
> I was recently trying to use it and was repeatedly getting memory limit
> errors at an 8MB limit. What the script does is load an image in memory,
> create three different thumbnail sizes for the image, imagedestroy() is
> being called after each thumbnail build to kill the thumb, and then
> finally I'm calling imagedestroy() at the end of the iteration for that
> image to kill the original in memory before going on to the next image.
...
> one. What I'm wondering is if anyone else has noticed this behavior, and
> aside from increasing the memory limit, have you found an alternative?
> I'm really trying to keep the scripts I have portable, so I haven't
> looked at ImageMagic, but I was wondering if the shmop functions might
> be the way to go with this. I do have reservations about using that
> though since it's not a 'default' in the build and I have some servers
> that I have no control over the software side of things, and I am trying
> to make these as generic as possible. If you've gotten this far thanks,
> sorry it turned out to be so long, but this is a rather important
> problem in what I'm coding.
>

Ever heard of the paragraph?  You should look into it

Strange that imagedestroy() is not freeing memory because, well, that's
what it is supposed to do.  I checked bugs.php.net and didn't find any
bug reports that match this description.  IMO you should submit a bug
report there and let the developers assess the problem.  My guess is
they will want to fix this.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] Newbie Variable Question

2005-03-09 Thread Jochem Maas
Jackson Linux wrote:
Hi, All,
A php variable question.
I've done this to take the requested category from the URL  
(www.foo.com/file.htm?r=1)
and use it to build the page:

if the category number is really always supposed to be an integer
(and that it must always be greater than 0, actually in 'real' DBs
an id doesn't have to be a positive number, zero and minus-numbers
are also fine) then:
if ( isset($_GET['r']) &&
 !empty($_GET['r']) &&
 ($r = intval($_GET['r'])) )
{
 // ...
} else {
 // ...
}
if you are sure that $r is a positive integer there is
no need to wrap it in quotes for use in the SQL, or
why not place the single quotes directly in the SQL:
$r = 1;
 $sql = "
SELECT 
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND
jobcat.jobcat_id=cvjobcats.jobcat_id";
// OR
 $sql = "
SELECT 
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = '$r' AND
jobcat.jobcat_id=cvjobcats.jobcat_id";
i.e. DONT WRAP change $r into a string which contains an integer wrapped in
single-quotes - JUST LEAVE IT AS AN INTEGER.
if (isset($_GET['r']) && !empty($_GET['r'])) {
$r = "'{$_GET['r']}'"; //Set the variable $r to mean the category number
$fields = '*';
} else {
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

In this case $r comes out literally to the number surrounded by single  
quotes (ie, '1'). And it works great.

But I need *just* the number for something later (to fetch an include  
indeed - STORE THE NUMBER IN $r - leave the single quotes out of it!
based on the category selected by $r). Since I've set the value of the  
field cv.category to mean the english translation from the intersecting  
table, using

 and then this will 'just work'
 asks for  
cv.'1'.include.php ... And I need it to ask for cv.1.include.php

How can I make a variable to fetch the literal number from the field  
cv.category?
if you a really stubborn SOB then you could do this:
$r = "'1'";
$x = (int) str_replace("'",'',$r); // warning this is lame
Thanks in advance!
Jack
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Newbie Variable Question

2005-03-09 Thread Jochem Maas
Jackson Linux wrote:
On 9 Mar 2005, at 11:15, Jason Barnett wrote:
Jackson Linux wrote:
...
 asks for
cv.'1'.include.php ... And I need it to ask for cv.1.include.php
How can I make a variable to fetch the literal number from the field
cv.category?

Not 100% certain that it will work, but try casting the variable $r to
an integer:


H. If  only. . .This returns, regardless of input and the value of $r
cv.0.include.php'
 For chuckles, I did check and the column is set in the table as INT.  
If that matters.
not really - what matters is that you understand typecasting in php.
a string when cast to an integer will always be zero unless the string
begins with numeric chars, in which case php will take all the numeric chars
it finds until it comes across a char that is not numeric and return those chars
(I don't know exactly how it handles decimal points and minus signs in such as 
case)
echo (int) "1string";
echo (int) "string1";
...?
Jack
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Internal Server Error ?!?

2005-03-09 Thread [EMAIL PROTECTED]
thankns guys for your help. problem solved. tech from hosting company 
said they had last night power problem and rebooted server few times and 
"left open some files" ?!? I didn't get this part but didn't have time 
and nervs to talk to him more.

Thanks!
-afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Pop-up message

2005-03-09 Thread pmpa
I believe one could also embed a small flash object and call the window open
from flash.
I'm just not sure if IE popup blocker will also block that window.

Pedro.

-Mensagem original-
De: Jochem Maas [mailto:[EMAIL PROTECTED] 

I don't know about 'CURRENT' but you have atleast 3 options:
1. if its an intranet app then just tell them they have to add the intranet
server
to a trusted zone (and that the browser should allow popups
2. dump your popup info in an absolutely positioned div and make the layer
visible on top of the rest of the page (with a js link that hides the layer
again)
3. use a js alert(), which you might consider ugly... BUT its modal, its not
blockable
(other than if js is turned off completely!) -- a user is therefore forced
to read the
alert and click OK in order to continue.
( ... ) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread Mat Harris
On Wed, Mar 09, 2005 at 07:30:57AM -0800, Rob Tanner wrote:
> Every ezmlm mailing list I'm on does that periodically.  Lists that I'm
> on that use MailMan never seem to have that problem.  What then does
> that tell us about ezmlm...

i get the same thing toobut as i run my own mail server i know when mail
should've been bouncing and this wasn't it.

I am recieving other mail perfectly at the times these msgs should have 
bounced

aah MailMan is wy better...even if its python ;)

> 
> --On Wednesday, March 09, 2005 09:53:35 AM -0500
> [EMAIL PROTECTED] wrote:
> 
> > Yeah, same here.  I thought it was my hosting service, but if other
> > people are having the same issue then what's the deal?   Usually it's
> > only a message or two, but sometimes it says there are like 8 or 9
> > messages that bounced.   Has anyone looked into this or have any
> > information regarding this?
> > 
> > I was wondering of other emails were bouncing trying to get to me and
> > just hadn't taken the time to follow up with my hosting company about
> > it.
> > 
> > -TG
> > 
> > = = = Original message = = =
> > 
> > Same here 
> > 
> > 
> > Christo van Rooyen 
> > 
> > 
> > -Original Message-
> > From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
> > Sent: 08 March 2005 19:58
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Cc: Kevin; PHP General Mail List
> > Subject: RE: [PHP] suspicious - maybe spam
> > 
> > Richard Lynch 
> > on Tuesday, March 08, 2005 9:54 AM said:
> > 
> >> Don't feel too bad.
> >> 
> >> Every few weeks, I get an automated email from ezmlm warning me that 
> >> php-general messages have bounced, and I might be removed from the 
> >> list if it keeps up.
> > 
> > Same here.
> > 
> > 
> > ___
> > Sent by ePrompter, the premier email notification software.
> > Free download at http://www.ePrompter.com.
> 
> 
> 
> -- 
> Rob Tanner
> UNIX Services Manager
> Linfield College, McMinnville OR
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
Before making criticism, try to walk a mile in their shoesthat way when
you do criticise them, you will be a mile away and wearing their shoes :)

Never knock on Death's door : ring the doorbell and run (he hates that). 


pgpjXLKhOyndC.pgp
Description: PGP signature


[PHP] PHP5.0.3-3 on RedHat

2005-03-09 Thread Bronislav Klucka
Hi,
does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap, 
openssl, curl, etc. :)

I'm looking every day on internet, but I cannot find it.
Brona
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Newbie Variable Question

2005-03-09 Thread Jackson Linux
Jochem and everyone,
Thanks, this solved the problem.
Regarding someone's much appreciated comment:
[this]...allows any user to simply change the value of "r" to 
something more to
their liking. given the reset of the code that you included in your
first message, who knows what nice holes they'll find in your code when
they do that. depending on where you go with this, they could end up
with information for/about another user, a nice sql injection on your
database, the ability to hack your system, or something else equally
amusing.

I agree, and actually had thought of it. I appreciate your reminding 
me. Because I am new enough that I still find a magical thrill every 
time I pull *anything* from the database, I have been approaching this 
from this point of view:

1. Make db
2. Try to get page to connect
3. Try to print what I want by setting the variable $r so I can point 
to it
4. Fix it so that if someone asks for anything other than an existent 
?r=x  it kicks back a webpage which just shows links to existing pages.

Which brings me to the next question, which I'll post in a second!
Thanks again everyone!
--Jack
On 9 Mar 2005, at 11:43, Jochem Maas wrote:
Jackson Linux wrote:
On 9 Mar 2005, at 11:15, Jason Barnett wrote:
Jackson Linux wrote:
...
 asks for
cv.'1'.include.php ... And I need it to ask for cv.1.include.php
How can I make a variable to fetch the literal number from the field
cv.category?

Not 100% certain that it will work, but try casting the variable $r 
to
an integer:



H. If  only. . .This returns, regardless of input and the value 
of $r
cv.0.include.php'
 For chuckles, I did check and the column is set in the table as INT. 
 If that matters.
not really - what matters is that you understand typecasting in php.
a string when cast to an integer will always be zero unless the string
begins with numeric chars, in which case php will take all the numeric 
chars
it finds until it comes across a char that is not numeric and return 
those chars
(I don't know exactly how it handles decimal points and minus signs in 
such as case)

echo (int) "1string";
echo (int) "string1";
...?
Jack

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Question re empty query

2005-03-09 Thread Jackson Linux
Hi,
This:
if (isset($_GET['r']) &&
 !empty($_GET['r']) &&
 ($r = intval($_GET['r'])) ){
$r = "{$_GET['r']}"; //Set the variable $r to mean the category number
$fields = '*';
$sort = "ORDER BY cv.sort";
} else {
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

Works whenever there is an ?r= specified. When there is no r specified  
it chokes on

WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

because there's no value to $r.
it also opens me up to allowing anyone to state *anything* after the ?.
So can I make an else statement which will say that if there's no r= or  
a wrong r= or even no ? at all then it should print a menu to $r's  
which actually exist in the database? How?

Thanks in advance!!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5.0.3-3 on RedHat

2005-03-09 Thread John Nichel
Bronislav Klucka wrote:
Hi,
does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap, 
openssl, curl, etc. :)

I'm looking every day on internet, but I cannot find it.
Brona
You can build the RPM from the source
rpmbuild -ta php-5.0.3xxx.tar.gz
It will put the RPM somewhere like /usr/src/redhat/RPMS/
--
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Shared variable / exclusive locking?

2005-03-09 Thread the_roibm
ok, so the solution is shm or shmop, but there is something I'm not
sure about it...
the way I wanna go is shm and sem and the things that are clear are:
- use sem to block multiple processes(or threads) writing to the same shm block
- there is no need to use sem for reading since multiple
processes(threads) can read safely from the same shm block

what is not that clear is... what happens when a process reads and
another writes exactly at the same time? do the read operations behave
like some sort of transactions that ensure you get the content
available in the shm block at the beginning of the read even when it
is changed during the read? I guess this is not the case, so how would
you handle this properly?

regards

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Question re empty query

2005-03-09 Thread M. Sokolewicz
Jackson Linux wrote:
Hi,
This:
if (isset($_GET['r']) &&
 !empty($_GET['r']) &&
 ($r = intval($_GET['r'])) ){
$r = "{$_GET['r']}"; //Set the variable $r to mean the category number
gods, that's an ugly statement... why don't you simply use $r = 
$_GET['r']; 

$fields = '*';
$sort = "ORDER BY cv.sort";
} else {
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

Works whenever there is an ?r= specified. When there is no r specified  
it chokes on

WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

because there's no value to $r.
it also opens me up to allowing anyone to state *anything* after the ?.
So can I make an else statement which will say that if there's no r= or  
a wrong r= or even no ? at all then it should print a menu to $r's  
which actually exist in the database? How?

Thanks in advance!!!
You have 3 conditions in a single expression. Split that expression up 
into multiple expressions, so you can check each (or a combination of 2) 
individually.

so, instead of:
if (isset($_GET['r']) && !empty($_GET['r']) && ($r = intval($_GET['r']))){
do:
if (isset($_GET['r'])) {
if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
// do whatever
} else {
// something boring
}
} else {
// not set
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5.0.3-3 on RedHat

2005-03-09 Thread Bronislav Klucka
John Nichel wrote:
Bronislav Klucka wrote:
Hi,
does anybody have PHP5.0.3-3 rpms files for RH9? I also need imap, 
openssl, curl, etc. :)

I'm looking every day on internet, but I cannot find it.
Brona
You can build the RPM from the source
rpmbuild -ta php-5.0.3xxx.tar.gz
It will put the RPM somewhere like /usr/src/redhat/RPMS/
I've done this... how can I specify php configure parameters? 
(--with-mysql, etc)

Brona
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] a new it company

2005-03-09 Thread Rory Browne
SPAMMER

>From your email address I'm assuming that your name is Sharvan Saxena.
It seems like too much of a coincidence that the contact person on
that site(Tanuj Saxena), and your good self, have the same surname.

Because it seems your are a spammer, and a liar(you concealed your
alleged connection with aforementioned site), I hereby CALL FOR A
BOYCOTT ON http://www.bansalsetech.com/

On Wed, 9 Mar 2005 10:57:39 +0530, shar <[EMAIL PROTECTED]> wrote:
> Hi members,
> 
> How are you. I have seen a very good site www.bansalsetech.com, visit this 
> site for your Seo / design / programming projects. Great people.
> 
> Regards
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP5.0.3-3 on RedHat

2005-03-09 Thread John Nichel
Bronislav Klucka wrote:
John Nichel wrote:

You can build the RPM from the source
rpmbuild -ta php-5.0.3xxx.tar.gz
It will put the RPM somewhere like /usr/src/redhat/RPMS/
I've done this... how can I specify php configure parameters? 
(--with-mysql, etc)

Brona
It's been a long time since I've done it this way, but I think it's 
something like this (I'm sure someone on the list will correct my 
errors)

Download and extract the source.
CD to the source directory...
>$ ./configure --add-your-options
>$ cd ..
>$ tar -cf php-5.0.3xx.tar php-5.0.3xx/
>$ rpmbuild -ta php-5.03xx.tar
Untested, but I think that's the steps.  You can also try 'make rpm' 
after you configure the source.  I seem to remember something along 
those lines.

Course, if you're going to go thru all that trouble, you could just 
build it all from source, and bypass the whole RPM process. ;)

--
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] how can I determine the built options of PHP

2005-03-09 Thread Uwe Galle
Hi,

some applications like Horde require special build options, eg.

--with-apache or: --with-apxs
--with-gettext
--with-mysql
--with-mcrypt
--with-iconv --enable-mbstring --with-mbstring=all
--with-gd

I don't want to setup my own build environment at the moment because I dont 
have the tools available now. I downloaded the PHP 5.0.3 Windows Binaries 
and want to know what options these Binaries were build with. How can I find 
out this? With phpinfo I didn't find this information.

Thanks for any help. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a new it company

2005-03-09 Thread Chris W. Parker
Rory Browne 
on Wednesday, March 09, 2005 10:06 AM said:

> Because it seems your are a spammer, and a liar(you concealed your
> alleged connection with aforementioned site), I hereby CALL FOR A
> BOYCOTT ON http://www.bansalsetech.com/

Ironic thing here is that there name is *already* asking you to ban
Salsa Tech from the list of companies that you would do business with.

Easy!


8)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread Lester Caine
[EMAIL PROTECTED] wrote:
Yeah, same here.  I thought it was my hosting service, but if other people are 
having the same issue then what's the deal?   Usually it's only a message or 
two, but sometimes it says there are like 8 or 9 messages that bounced.   Has 
anyone looked into this or have any information regarding this?
I was wondering of other emails were bouncing trying to get to me and just hadn't taken the time to follow up with my hosting company about it.

Every few weeks, I get an automated email from ezmlm warning me that 
php-general messages have bounced, and I might be removed from the 
list if it keeps up.
Same here - but since I only use the newsgroup interface I suspect 
something is wrong ;)

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] a new it company

2005-03-09 Thread Jochem Maas
Rory Browne wrote:
SPAMMER
From your email address I'm assuming that your name is Sharvan Saxena.
It seems like too much of a coincidence that the contact person on
that site(Tanuj Saxena), and your good self, have the same surname.
Because it seems your are a spammer, and a liar(you concealed your
I'd class him as stupid or ignorant maybe - but one hand sent email doesn't
really class someone as a spammer does it, I thought the bar was a little
higher than 1 email :-)
alleged connection with aforementioned site), I hereby CALL FOR A
BOYCOTT ON http://www.bansalsetech.com/
the joke is that this list is full of people who earn a living doing
seo / design / programming - then again I could outsource all my shit to this
guy for $1/hour and make a killing doing nothing ;-)
On Wed, 9 Mar 2005 10:57:39 +0530, shar <[EMAIL PROTECTED]> wrote:
Hi members,
How are you. I have seen a very good site www.bansalsetech.com, visit this site 
for your Seo / design / programming projects. Great people.
Regards


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] orphan functions, how can I find them?

2005-03-09 Thread Al
I'm cleaning up some old php scripts and find I'm creating some orphans.
Anyone know of a tool, or a simple way, to identify all the unused functions in 
a script's functions include file?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question re empty query

2005-03-09 Thread Jochem Maas
Jackson Linux wrote:
Hi,
This:
if (isset($_GET['r']) &&
 !empty($_GET['r']) &&
 ($r = intval($_GET['r'])) ){
$r = "{$_GET['r']}"; //Set the variable $r to mean the category number
for starters WTF is the preceding statement for???
$r is already set if it exists by the expression in the if statement...
($r = intval($_GET['r'])

$fields = '*';
$sort = "ORDER BY cv.sort";
} else {
this else block will fire if $r is invalid or not set.
that means this is where you should write some code that
either redirects to the 'list' page or outputs a list somehow.
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

Works whenever there is an ?r= specified. When there is no r specified  
it chokes on

WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

because there's no value to $r.
it also opens me up to allowing anyone to state *anything* after the ?.
So can I make an else statement which will say that if there's no r= or  
a wrong r= or even no ? at all then it should print a menu to $r's  
which actually exist in the database? How?
you already have one - its just that your abusing it to set some completely 
pointless
vars that containing bits of SQL.
Thanks in advance!!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] a new it company

2005-03-09 Thread John Nichel
Brian Dunning wrote:
Sharvan -
You won't find too many fans of overseas outsourcing on this list.
I'm a fan of it if they send ME overseas to outsource.  Italy, Germany, 
Greece, AustraliaI'll go.  ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] orphan functions, how can I find them?

2005-03-09 Thread Jochem Maas
Al wrote:
I'm cleaning up some old php scripts and find I'm creating some orphans.
Anyone know of a tool, or a simple way, to identify all the unused 
functions in a script's functions include file?

grep.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Fwd: Re: [PHP] PHP / JavaScript integration]

2005-03-09 Thread Jochem Maas
this post was meant for the OP - I sent it to Chris W. (only) by mistake.
oops
 Original Message 
From: - Wed Mar 09 19:50:29 2005
Chris W. Parker wrote:
Mário Gamito 
on Tuesday, March 08, 2005 4:28 PM said:

I'm trying to integrate some JavaScript functions in PHP, but so far,
no good :(

[snip]

Now... i want to call this JavaScript function from the regular PHP
files. In particular, before the HTML code.
Like this:

[snip]

How can i do this ?
How to tell PHP, that def(word) is a JS function in js.php file ?
I've tried include ('js.php'), etc., but got no results :(
include ('js.php') will output the contents of that file to the browser,
assuming include() actually finds the file.

You don't and you can't. PHP does not interact with the client (like you are thinking it does) and 
Javascript does not interact with the server. They are completely different and not related, except 
that PHP can send Javascript to the client for the client to interpret.
javascript is a scripting language, there is no theoretical reason that it 
can't be used as a serverside
scripting language, but the fact that practically nobody in the real does says 
something :-). anyway
its not strictly correct to say javascript is 'clientside'.
as for calling a javascript function directly from php code, forget about it.
It's a bit confusing at first but once you understand it, you'll wonder why it ever didn't make sense.
1 round trip:
1. a (php) webserver gets a request for a page.
2. the server runs the requested (php) script.
3. the server sending some output to the browser.
4. the browser interprets the output.
the output is generally a webpage - this can include

Re: [PHP] a new it company

2005-03-09 Thread Brian Dunning
Sharvan -
You won't find too many fans of overseas outsourcing on this list.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: how can I determine the built options of PHP

2005-03-09 Thread Jason Barnett
I'm not 100% sure what options are used in the Windows build by default,
but for windows everything is wrapped up into extensions.  You need
mysql, you enable the appropriate mysql .dll.  You need Apache, you use
the appropriate apache .dll.  And all of that is controlled through
php's ini and/or the apache conf file.

Now if you *really* want to build PHP on Windows you can get a free
(GPL) compiler.  Just go download cygwin and use gcc.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] a new it company

2005-03-09 Thread Dan Tappin
I think Rory has trouble jumping to conclusions.  I was attacked off 
list by Rory thinking I was another list member... another dant 
(remember the OT adult content rant / thread?).

I would agree that this is not really spam... just bad judgment.  The 
flood of angry replies to this poster should teach them their lesson 
about mailing list etiquette.  If it continues they will simply be 
banned from the list.

With free speech you have to live with the odd incident like this.
Dan Tappin (Dan T)
On Mar 9, 2005, at 11:29 AM, Jochem Maas wrote:
Rory Browne wrote:
SPAMMER
From your email address I'm assuming that your name is Sharvan Saxena.
It seems like too much of a coincidence that the contact person on
that site(Tanuj Saxena), and your good self, have the same surname.
Because it seems your are a spammer, and a liar(you concealed your
I'd class him as stupid or ignorant maybe - but one hand sent email 
doesn't
really class someone as a spammer does it, I thought the bar was a 
little
higher than 1 email :-)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Serious problem with Compiler?!?

2005-03-09 Thread Stefan
Hi there,
my Server worked fine for several month now with php 4.3.4.
Since a few hours (without changing anything for the last days) PHP 
doesn't 'know' basic commands as mysql_connect() or session_start() ...
(e.g.: Fatal error: Call to undefined function: mysql_connect() )

I have no idea where to start searching for the problem as the logs 
don't tell anything about it!

Thx for help in advance.
Stefan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Question re empty query

2005-03-09 Thread Jochem Maas
M. Sokolewicz wrote:
Jackson Linux wrote:
Hi,
This:
if (isset($_GET['r']) &&
 !empty($_GET['r']) &&
 ($r = intval($_GET['r'])) ){
does nobody notice the last 'bit' of the if expression??
if the IF statement evaluates to true then $r _has_ been set!!!
$r = "{$_GET['r']}"; //Set the variable $r to mean the category number
gods, that's an ugly statement... why don't you simply use $r = 
$_GET['r']; 
that leaves him completely open to SQL injection.
but your right in that writing this:
$r = "{$_GET['r']}";
... is just plain wasteful, pointless and looks ugly.
and given the fact that $r is already set (see above) there is
no need to set it again at all.
I think you almost there Jackson, keep hacking :-)

$fields = '*';
$sort = "ORDER BY cv.sort";
} else {
$where = '';
$fields =  
'cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,  
jobcat.category';
$sort = "ORDER BY cv.sort";
}

//Make the sql based on the joining of the table and intersection table
$sql = "
SELECT  
cv.cv_id,cv.category,dates,cv.job_title,cv.company,cv.job,cv.sort,jobcat 
.category
FROM cv, cvjobcats, jobcat
WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

Works whenever there is an ?r= specified. When there is no r 
specified  it chokes on

WHERE cvjobcats.cv_id=cv.cv_id AND cvjobcats.jobcat_id = $r AND  
jobcat.jobcat_id=cvjobcats.jobcat_id";

because there's no value to $r.
it also opens me up to allowing anyone to state *anything* after the ?.
So can I make an else statement which will say that if there's no r= 
or  a wrong r= or even no ? at all then it should print a menu to 
$r's  which actually exist in the database? How?

Thanks in advance!!!
You have 3 conditions in a single expression. Split that expression up 
Jackson got that bit from me - I don't think he is fully aware of what that
expression is doing!
the 'sum' of those conditions determines that either $r is 'good' or 'bad'
(whether $r is garbage or not set didn't seem like a difference worth bothering
with)
into multiple expressions, so you can check each (or a combination of 2) 
individually.
this is a good idea to better understand what is going on!
so, instead of:
if (isset($_GET['r']) && !empty($_GET['r']) && ($r = intval($_GET['r']))){
do:
if (isset($_GET['r'])) {
if(!empty($_GET['r']) && ($r = intval($_GET['r']))){
// do whatever
} else {
// something boring
}
} else {
// not set
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Serious problem with Compiler?!?

2005-03-09 Thread Jochem Maas
Stefan wrote:
Hi there,
my Server worked fine for several month now with php 4.3.4.
Since a few hours (without changing anything for the last days) PHP 
reboot? lame yes, but maybe it works.
otherwise specify some server details here.
check if files (e.g. the php binary, conf files) have changed
(maybe a very recent filetime?)
doesn't 'know' basic commands as mysql_connect() or session_start() ...
(e.g.: Fatal error: Call to undefined function: mysql_connect() )
I have no idea where to start searching for the problem as the logs 
don't tell anything about it!
mysql is an extension but session_start is core I believe - very odd
that session_start() is not defined.
Thx for help in advance.
Stefan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] a new it company

2005-03-09 Thread Jochem Maas
Dan Tappin wrote:
I think Rory has trouble jumping to conclusions.  I was attacked off 
list by Rory thinking I was another list member... another dant 
(remember the OT adult content rant / thread?).
who me? :-)
I would agree that this is not really spam... just bad judgment.  The 
flood of angry replies to this poster should teach them their lesson 
about mailing list etiquette.  If it continues they will simply be 
banned from the list.

With free speech you have to live with the odd incident like this.
here here - I thought It was kind of humourous, I also bare in mind
that these guys in the far east are just trying to make their way in the
world too, they are at a disadvantage with the language also. besides
which there is a quite a culture gap - I notice it alot in the way people
from India/FarEast ask questions in general - its a totally
different 'style'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help with dates

2005-03-09 Thread Kevin
Mr Lynch,

Thanks a lot for your help so far! I will answer or respond in message.

Yours,

Kevin

"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Kevin wrote:
> > Right now I'm working on a script that would calculate dates from one
> > calendar to another. The normal calendar we use and a newly invented
one.
>
> [shudder]
> There are already WAY too many calendar systems.
>
> Inventing a new one is probably not such a good plan...
>
> Why re-invent the wheel?

It's part of a game. In the RPG there are dates which the players would like
to be able to convert from our calendar to that one, and back again..

>
> > In order to do that I need to find the exact days since the year 0
BC/AD.
> > However, the functions php provides only allow up to the unix epoch.
> >
> > Could you guys give me some pointers on how to accomplish this,
> > accurately?
>
> Take a look at the MySQL date ranges -- They may have a data type that
> allows for more than just 1/1/1970 to 3/??/2038
>
> If not, consider using PostgreSQL which has VERY extensive and flexible
> date support, for ranges MUCH larger than 0 BC/AD.
> http://postgresql.org
>
> I believe PostgreSQL even supports time scales on the order of geological
> events and for astronomical purposes, though not with "day" accuracy.
>
> I am assuming that by "accurately" you mean "to the nearest day" since you
> spoke of "exact days", right?

Aye.. it's nearest day, and according to calculations should have repeatable
results. So what is date X today should also be it tomorrow (after the
calculations of course). That's what i've noticed so far. when I add a date
and convert it and then convert it back it is a different date.

>
> But you didn't define how far into the future you need to go.
> Current time?
> A few years out?
> Stardates from Star Trek?
> You have to specify a start date, end date, and accuracy to choose a
> correct calendar system.

It's mostly the past. The RPG is set in Egypt and the beginning of the
society in egypt has been taken as year 0. The start date I think is
obvious, but I do not understand an end date of a calendar.. Perhaps I'm
just blond.. but could you perhaps explain that one?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] posix_getgroups() and effective grooup id's

2005-03-09 Thread Marten Lehmann
Hello,
while I can use posix_getgroups() to get groups additional to the 
posix_getgid() value, I don't know which function to use to find out the 
groups additional to posix_getegid(). There's no posix_getegroups() 
function.

Regards
Marten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Serious problem with Compiler?!?

2005-03-09 Thread Stefan
I've found where the problem came from: I was using PHP 4.3.9 (sorry for 
misinformation in the first mail) but it was overwritten by a suse 
onlineupdate 4.3.4 last night. This is where the problems came from.

I have removed 4.3.4 via Yast and want to compile 4.3.10 now.
./configure and make test work fine, but when I use 'make', it only 
shows a few lines and doesn't install successfull:

This is all text produced by make:
<-- begin
Installing PHP SAPI module:   apache2handler
/usr/share/apache2/build/instdso.sh 
SH_LIBTOOL='/usr/share/apache2/build/libtool' libphp4.la 
/usr/lib/apache2-prefork
/usr/share/apache2/build/libtool --mode=install cp libphp4.la 
/usr/lib/apache2-prefork/
cp .libs/libphp4.so /usr/lib/apache2-prefork/libphp4.so
cp .libs/libphp4.lai /usr/lib/apache2-prefork/libphp4.la
libtool: install: warning: remember to run `libtool --finish 
/usr/local/src/php-4.3.10/libs'
chmod 755 /usr/lib/apache2-prefork/libphp4.so
[activating module `php4' in /etc/apache2/httpd2-prefork.conf]
Installing build environment: /usr/lib/php/build/
Installing header files:  /usr/include/php/
Installing helper programs:   /usr/bin/
  program: phpize
  program: php-config
  program: phpextdist

--> end
What may be the source of this problem?
Jochem Maas wrote:
Stefan wrote:
Hi there,
my Server worked fine for several month now with php 4.3.4.
Since a few hours (without changing anything for the last days) PHP 

reboot? lame yes, but maybe it works.
otherwise specify some server details here.
check if files (e.g. the php binary, conf files) have changed
(maybe a very recent filetime?)
doesn't 'know' basic commands as mysql_connect() or session_start() ...
(e.g.: Fatal error: Call to undefined function: mysql_connect() )
I have no idea where to start searching for the problem as the logs 
don't tell anything about it!

mysql is an extension but session_start is core I believe - very odd
that session_start() is not defined.
Thx for help in advance.
Stefan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Best way to validate a date

2005-03-09 Thread David Bevan
Hi all,

I'm looking to validate a date submitted through a
form and I cannot decide which would be the best way
to do it.  The form of the date needs to be:
-MM-DD.
At the moment I'm torn between using a regex,
something like: 20[\d][\d]-[0-1][\d]-[0-3][\d]
or using the checkdate() function.

Does anyone have any pros and/or cons to implement one
method over the other or other methods you may have
used?

Thanks,
David

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] a new it company

2005-03-09 Thread Ryan A

> here here - I thought It was kind of humourous, I also bare in mind
>
> that these guys in the far east are just trying to make their way in the
>
> world too, they are at a disadvantage with the language also. besides
>
> which there is a quite a culture gap - I notice it alot in the way people
>
> from India/FarEast ask questions in general - its a totally
>
> different 'style'


I agree but thats not a reason to write to this list with that crap, I
replied to him with two words...the first word started with a F and was four
letters, the second was a three letter word :-)

I also agree with the bloke about boycotting that site and I vote we also
write "bad things" about that site on all the websites we control :-D

As for the spam part, writing one email to a person I think cannot be called
spam...but I think this falls into spam as he wrote to the list which spills
out to many many peopleits as good as if he copied all the addresses
from the list and used a mass mailer to mail the message/crap/spam to all of
us individually

My $0.02

Cheers,
Ryan





> >
>
>
>
> --
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with dates

2005-03-09 Thread Jochem Maas
...
Why re-invent the wheel?

It's part of a game. In the RPG there are dates which the players would like
to be able to convert from our calendar to that one, and back again..

In order to do that I need to find the exact days since the year 0
BC/AD.
why is OBC relevant, I read later on that you take the start of egyptian
civilization as zero. is that not much earlier.
whats the structure of the egyptian|rpg calendar?

However, the functions php provides only allow up to the unix epoch.
Could you guys give me some pointers on how to accomplish this,
accurately?
Take a look at the MySQL date ranges -- They may have a data type that
allows for more than just 1/1/1970 to 3/??/2038
If not, consider using PostgreSQL which has VERY extensive and flexible
date support, for ranges MUCH larger than 0 BC/AD.
http://postgresql.org
I believe PostgreSQL even supports time scales on the order of geological
events and for astronomical purposes, though not with "day" accuracy.
+1 on using a DB to calculate and format dates on this one :-)
I'm guessing Kevins probably written an SQL statement before and he's
already proved he can RTFPM (P for PHP)
I am assuming that by "accurately" you mean "to the nearest day" since you
spoke of "exact days", right?

Aye.. it's nearest day, and according to calculations should have repeatable
results. So what is date X today should also be it tomorrow (after the
calculations of course). That's what i've noticed so far. when I add a date
and convert it and then convert it back it is a different date.
show us some code :-)

But you didn't define how far into the future you need to go.
Current time?
A few years out?
Stardates from Star Trek?
You have to specify a start date, end date, and accuracy to choose a
correct calendar system.

It's mostly the past. The RPG is set in Egypt and the beginning of the
society in egypt has been taken as year 0. The start date I think is
obvious, but I do not understand an end date of a calendar.. Perhaps I'm
just blond.. but could you perhaps explain that one?
I must be blond, I don't even grok that question :-/
rgds,
jochem
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] shell script - disable log output

2005-03-09 Thread Eli
Hello...
I'm writing a shell script that uses error_log function to log some 
data, but it echos the error message to the output without logging the 
message to the log file.

Code I use (php5 on unix):
*
#!/usr/local/php/bin/php -q

*
OUTPUT:
$ test.php
My error message
$
How can I prevent the error messages from being echoed to the client?
-thanks, Eli
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Best way to validate a date

2005-03-09 Thread Eli
David Bevan wrote:
Hi all,
I'm looking to validate a date submitted through a
form and I cannot decide which would be the best way
to do it.  The form of the date needs to be:
-MM-DD.
At the moment I'm torn between using a regex,
something like: 20[\d][\d]-[0-1][\d]-[0-3][\d]
or using the checkdate() function.
Does anyone have any pros and/or cons to implement one
method over the other or other methods you may have
used?
Thanks,
David
Better use checkdate, since it checks if the date really exists (not 
just well formatted).
Mabye do something like this:

list($check_year,$check_month,$check_day) = explode("-",$date);
if (checkdate($check_month,$check_day,$check_year))
echo "Date is valid";
else
echo "Date is not valid";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Question regarding simplexml predefined constants

2005-03-09 Thread Allan, David (ThomasTech)
In reading the documentation on simplexml predefined constants, I see a note
that says these were added to "PHP 5.1.0".

Am I reading that [future] version correctly, and I can expect that these
are to be released in a forthcoming stable release, and in fact do not yet
exist in the version I am using (5.0.3)?

TIA,

David Allan
mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] shell script - disable log output

2005-03-09 Thread Matthew Fonda
I suppose error_log("My error message", 3, "/dev/null") would work.

On Wed, 2005-03-09 at 12:59, Eli wrote:
> Hello...
> 
> I'm writing a shell script that uses error_log function to log some 
> data, but it echos the error message to the output without logging the 
> message to the log file.
> 
> Code I use (php5 on unix):
> *
> #!/usr/local/php/bin/php -q
>  error_log("My error message");
> ?>
> *
> OUTPUT:
> $ test.php
> My error message
> $
> 
> How can I prevent the error messages from being echoed to the client?
> 
> -thanks, Eli
-- 
Regards,
Matthew Fonda
http://mfonda.info

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Quickform - edit form

2005-03-09 Thread Leonie \(phpgroup\)
I've set up a form using Quickform. I've got it working a dream. My 
problem is at the moment it only adds records to the database. I would 
like to also have an edit form. I don't know what is easiest. Amend the 
existing form so it enters data and edits it, or have two different 
webpages.

Also I'm having trouble working out how to assign data to the form. Can 
anyone point me to an example?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: shell script - disable log output

2005-03-09 Thread Eli
I suppose error_log("My error message", 3, "/dev/null") would work.
I cannot change the error_log() params, since it is cored in extern lib 
I use.
Is there a way to prevent the default error_log() from being outputed?

-thanks, Eli
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help with dates

2005-03-09 Thread Jason Barnett
Jochem Maas wrote:
> 
>> It's mostly the past. The RPG is set in Egypt and the beginning of the
>> society in egypt has been taken as year 0. The start date I think is
>> obvious, but I do not understand an end date of a calendar.. Perhaps I'm
>> just blond.. but could you perhaps explain that one?
>>
>
> I must be blond, I don't even grok that question :-/
>
> rgds,
> jochem

It comes down to the amount of information that you can store in memory.
 Consider: my start date is 6000 BC.  And I believe that the universe
will end around, say, 320 Quadrillion AD.  And I want accuracy in my
calendar (that is I can convert time) to the nearest second.  Good luck
finding a computer that can easily handle that!  Heck, good luck even
trying to store all of the seconds of the calendar as bytes on the computer!

This problem is related to the Y2K "bug".  Back when hard drive storage
/ memory was more expensive they needed to find ways to express more
information with less technology.  So they traded accuracy for
efficiency and dates were stored with two digits in each year.  It was
ok though because the expected life of the program wasn't supposed to be
beyond 2000.

So getting back to *this* problem... what exactly is the relevant span
of time?  Will game time in the RPG extend for thousands of years?
Hundreds of thousands?  Would it really be ancient Egypt once you make
it past 0 BC?

So decide on an upper limit for the game calendar.  And decide the
accuracy you need (nearest day, etc.) and then you can create functions
that will do the necessary date conversions.  It can be in PHP or in the
DB itself... but that's the next step in the decision process.  :)

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] shell script - disable log output

2005-03-09 Thread John Nichel
Eli wrote:
Hello...
I'm writing a shell script that uses error_log function to log some 
data, but it echos the error message to the output without logging the 
message to the log file.

Code I use (php5 on unix):
*
#!/usr/local/php/bin/php -q

*
OUTPUT:
$ test.php
My error message
$
How can I prevent the error messages from being echoed to the client?
Try
@error_log ( "My error message" );
Don't know if it will work, but it's worth a shot.
--
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Question regarding simplexml predefined constants

2005-03-09 Thread Jason Barnett
David Allan wrote:
> In reading the documentation on simplexml predefined constants, I see a note
> that says these were added to "PHP 5.1.0".
>
> Am I reading that [future] version correctly, and I can expect that these
> are to be released in a forthcoming stable release, and in fact do not yet
> exist in the version I am using (5.0.3)?

That is a safe assumption.  The dev team has been working on the 5.1.0
release for some time now and I guess the documentation team got to this
one early.  And no, they do not exist in your current version (5.0.3).

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


[PHP] Re: shell script - disable log output

2005-03-09 Thread Jason Barnett
Eli wrote:
>> I suppose error_log("My error message", 3, "/dev/null") would work.
>

http://php.net/manual/en/ref.errorfunc.php#ini.error-log

try:

ini_set('error_log', null)

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] shell script - disable log output

2005-03-09 Thread Eli
John Nichel wrote:
Try
@error_log ( "My error message" );
Don't know if it will work, but it's worth a shot.
Checked. That's not working, since the @ operator prevents logging of 
errors/warnings/notices that caused by the expression following, but 
doesn't prevent from the expression to be executed.

Besides, I can't change the syntax of the error_log which is used with 
defaults: error_log(MSG);

-thanks, Eli
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Help with dates

2005-03-09 Thread Jochem Maas
Jason Barnett wrote:
Jochem Maas wrote:

It's mostly the past. The RPG is set in Egypt and the beginning of the
society in egypt has been taken as year 0. The start date I think is
obvious, but I do not understand an end date of a calendar.. Perhaps I'm
just blond.. but could you perhaps explain that one?
I must be blond, I don't even grok that question :-/
rgds,
jochem

It comes down to the amount of information that you can store in memory.
 Consider: my start date is 6000 BC.  And I believe that the universe
will end around, say, 320 Quadrillion AD.  And I want accuracy in my
calendar (that is I can convert time) to the nearest second.  Good luck
finding a computer that can easily handle that!  Heck, good luck even
trying to store all of the seconds of the calendar as bytes on the computer!
er...grok.
thanks Jason :-)
This problem is related to the Y2K "bug".  Back when hard drive storage
/ memory was more expensive they needed to find ways to express more
information with less technology.  So they traded accuracy for
efficiency and dates were stored with two digits in each year.  It was
ok though because the expected life of the program wasn't supposed to be
beyond 2000.
So getting back to *this* problem... what exactly is the relevant span
of time?  Will game time in the RPG extend for thousands of years?
Hundreds of thousands?  Would it really be ancient Egypt once you make
it past 0 BC? 
egypt is pre 0BC, even Discovery Channel admits that :-)
(0BC is 2005 years ago)
So decide on an upper limit for the game calendar.  And decide the
accuracy you need (nearest day, etc.) and then you can create functions
that will do the necessary date conversions.  It can be in PHP or in the
DB itself... but that's the next step in the decision process.  :)
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: shell script - disable log output

2005-03-09 Thread Eli
Jason Barnett wrote:
Eli wrote:
I suppose error_log("My error message", 3, "/dev/null") would work.

http://php.net/manual/en/ref.errorfunc.php#ini.error-log
try:
ini_set('error_log', null)
Doesn't work either.. :( but thanks for trying..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] shell script - disable log output

2005-03-09 Thread John Nichel
Eli wrote:
John Nichel wrote:
Try
@error_log ( "My error message" );
Don't know if it will work, but it's worth a shot.
Checked. That's not working, since the @ operator prevents logging of 
errors/warnings/notices that caused by the expression following, but 
doesn't prevent from the expression to be executed.

Besides, I can't change the syntax of the error_log which is used with 
defaults: error_log(MSG);

-thanks, Eli
Try output buffering and dumping the buffer to /dev/null?
--
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] shell script - disable log output

2005-03-09 Thread Eli
John Nichel wrote:
Try output buffering and dumping the buffer to /dev/null?
From all the suggestions the script now looks like this:
#!/usr/local/php5/bin/php -q

But it still output the error to the screen.. :(
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Creating Reports with PHP

2005-03-09 Thread Mike Smith
I am trying to find a systematic way to develop reports for our custom
web app. What I've done in the past is basically create a query, dump
it to an HTML table, and put a link to open the report in Excel. I
would like to develop a report system that would allow a user (I have
2 advanced users that are comfortable at creating SQL queries) to
copy-and-paste a query into a form, identify how the report should be
grouped and add basic functions like sum() a particular column. Not an
outstanding solution security wise.

I'm currently investingating phpreports
(http://phpreports.sourceforge.net/). It looks promising, but it's not
working in my environment (Windows, SQL Server 2000)...yet. It's
getting there, but are there any other "reporting" packages anyone
could recommend? phpclasses.org had several, ,but they were MySQL
specific. I'd like, ideally, to be able to use MSSQL,Postgres or MySQL
(ADODB or PEAR).

TIA,
Mike Smith

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] shell script - disable log output

2005-03-09 Thread John Nichel
Eli wrote:
 From all the suggestions the script now looks like this:
#!/usr/local/php5/bin/php -q

But it still output the error to the screen.. :(
I saw someone suggest this
error_log ( "My error message", 3, "/dev/null" );
And that works fine on my machine...have you tried that?
--
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Quickform - edit form

2005-03-09 Thread Chris W. Parker
Leonie (phpgroup) 
on Wednesday, March 09, 2005 1:13 PM said:

> I've set up a form using Quickform. I've got it working a dream. My
> problem is at the moment it only adds records to the database. I would
> like to also have an edit form. I don't know what is easiest. Amend
> the existing form so it enters data and edits it, or have two
> different webpages.

I would use the same page. Have the page determine whether or not the
page is being used to add an entry or to edit an entry. Then act
accordingly.

> Also I'm having trouble working out how to assign data to the form.
> Can anyone point me to an example?

Without some code my response is going to be sarcastic.

DID YOU TRY THIS??

\n";

?>

Look! I just assigned data to the form!



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quickform - edit form

2005-03-09 Thread Richard Lynch

> I've set up a form using Quickform. I've got it working a dream. My
> problem is at the moment it only adds records to the database. I would
> like to also have an edit form. I don't know what is easiest. Amend the
> existing form so it enters data and edits it, or have two different
> webpages.
>
> Also I'm having trouble working out how to assign data to the form. Can
> anyone point me to an example?

I always go for the "one form" system, because otherwise you have double
the work to do (opening two files) every little change, and invariably one
of the forms drifts out of sync when (not if, when) you forget to change
the other form and...

Assigning data to the form mostly consists of using the VALUE= attribute
in HTML tags, except TEXTAREA where it goes between opening/closing tag.

Basic logic flow:



   //form data here


Yes, you display the form again with the data to edit, right after an insert.

That's by DESIGN, since it will help catch "ooops!" on data entry by
re-confirming with the user what they just did.  Better data entry is
good.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quickform - edit form

2005-03-09 Thread Marek Kilimajer
Leonie (phpgroup) wrote:
I've set up a form using Quickform. I've got it working a dream. My 
problem is at the moment it only adds records to the database. I would 
like to also have an edit form. I don't know what is easiest. Amend the 
existing form so it enters data and edits it, or have two different 
webpages.

Also I'm having trouble working out how to assign data to the form. Can 
anyone point me to an example?

Use either HTML_QuickForm::setDefaults() to set defaults for all 
elements or HTML_QuickForm_element::setValue() to set value for 
individual elements. Former is simpler, and if you name the forms 
elements after the table columns, you can directly pass in array fetched 
from sql query.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] shell script - disable log output

2005-03-09 Thread Eli
John Nichel wrote:
Eli wrote:
 From all the suggestions the script now looks like this:
#!/usr/local/php5/bin/php -q

But it still output the error to the screen.. :(
I saw someone suggest this
error_log ( "My error message", 3, "/dev/null" );
And that works fine on my machine...have you tried that?
Basically, I cannot change the line of the error_log() since it used in 
extern lib. I can only add lines before the include (that calls it) to 
prevent this, or call php with some other params (on the first exec line 
#!/usr/...), but nothing helps so far for this situation.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Serious problem with Compiler?!?

2005-03-09 Thread Richard Lynch
> I have removed 4.3.4 via Yast and want to compile 4.3.10 now.
> ./configure and make test work fine, but when I use 'make', it only
> shows a few lines and doesn't install successfull:

What few lines?

> This is all text produced by make:
> <-- begin
>
> Installing PHP SAPI module:   apache2handler
> /usr/share/apache2/build/instdso.sh
> SH_LIBTOOL='/usr/share/apache2/build/libtool' libphp4.la
> /usr/lib/apache2-prefork
> /usr/share/apache2/build/libtool --mode=install cp libphp4.la
> /usr/lib/apache2-prefork/
> cp .libs/libphp4.so /usr/lib/apache2-prefork/libphp4.so
> cp .libs/libphp4.lai /usr/lib/apache2-prefork/libphp4.la
> libtool: install: warning: remember to run `libtool --finish
> /usr/local/src/php-4.3.10/libs'
> chmod 755 /usr/lib/apache2-prefork/libphp4.so
> [activating module `php4' in /etc/apache2/httpd2-prefork.conf]
> Installing build environment: /usr/lib/php/build/
> Installing header files:  /usr/include/php/
> Installing helper programs:   /usr/bin/
>program: phpize
>program: php-config
>program: phpextdist
>
> --> end
>
> What may be the source of this problem?

What problem?

Looks to me like you did "make install" and it worked fine...

Re-start Apache and see what happens.


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] posix_getgroups() and effective grooup id's

2005-03-09 Thread Richard Lynch

> Hello,
>
> while I can use posix_getgroups() to get groups additional to the
> posix_getgid() value, I don't know which function to use to find out the
> groups additional to posix_getegid(). There's no posix_getegroups()
> function.

You may be stuck with:
\n";
  echo implode("", $output);
?>

You'd want to do more than just echo the output, of course.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] shell script - disable log output

2005-03-09 Thread Richard Lynch
> I'm writing a shell script that uses error_log function to log some
> data, but it echos the error message to the output without logging the
> message to the log file.

"the log file"...

*WHAT* log file?

A shell script has no pre-determined log file, really.

Actually, it's almost for sure STDOUT at that point, or maybe STDOUT, but
I doubt it.  If you were coding PHP engine and needed to send error output
somewhere under shell circumstances, you'd think STDOUT would be "it"
right?...

So you can probably re-direct 2 (STDOUT) to somewhere to get the error_log
output where you want it.

I think in most shells that turns into:
test.php 2> /var/log/test
YMMV
It's up to you to figure out re-directs in your shell of choice.  Good luck.

You should probably use can use set_error_handler to trap errors -- though
that will not catch error_log output, I don't think.

You can also use set_error_reporting() to get rid of errors entirely,
though that's not recommended.

> Code I use (php5 on unix):
> *
> #!/usr/local/php/bin/php -q
>  error_log("My error message");
> ?>
> *
> OUTPUT:
> $ test.php
> My error message
> $
>
> How can I prevent the error messages from being echoed to the client?

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help with dates

2005-03-09 Thread Richard Lynch
>> > Right now I'm working on a script that would calculate dates from one
>> > calendar to another. The normal calendar we use and a newly invented
> one.
>>
>> [shudder]
>> There are already WAY too many calendar systems.
>>
>> Inventing a new one is probably not such a good plan...
>>
>> Why re-invent the wheel?
>
> It's part of a game. In the RPG there are dates which the players would
> like
> to be able to convert from our calendar to that one, and back again..

You'll be way better off finding an existing calendar that "fits" your
criteria than inventing a new one.

>> But you didn't define how far into the future you need to go.
>> Current time?
>> A few years out?
>> Stardates from Star Trek?
>> You have to specify a start date, end date, and accuracy to choose a
>> correct calendar system.
>
> It's mostly the past. The RPG is set in Egypt and the beginning of the
> society in egypt has been taken as year 0. The start date I think is
> obvious, but I do not understand an end date of a calendar.. Perhaps I'm
> just blond.. but could you perhaps explain that one?

Here's your IDEAL calendar:

Your start date is 0 BC.

So let's make that be represented by: 0
Day 1 is, errr, December 26, 0 BC, represented by: 1
Day 2, December 27, 0 BC, represented by: 3
.
.
.

You can now calculate what's 2 billion+ (0x to be precise) days
later, and that would be the last date you could conveniently represent in
a 32-bit integer.

Do you expect the characters/events in your RPG to extend beyond 2 billion
days from December 25, 0 BC?

If so, then a 32-bit integer, one integer per day, simply won't cut it.

If not, then the above is an "ideal" date system.

Now, that was your "ideal" system.  Find a system that comes close to that.

http://mysql.com
http://postgresql.org

PS Historians are ready to shoot me for using 12/25/ as 0 BC, but
that's their problem, not mine.  It's an RPG.  We're not looking for
historical accuracy here!

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how can I determine the built options of PHP

2005-03-09 Thread Richard Lynch

> Hi,
>
> some applications like Horde require special build options, eg.
>
> --with-apache or: --with-apxs
> --with-gettext
> --with-mysql
> --with-mcrypt
> --with-iconv --enable-mbstring --with-mbstring=all
> --with-gd
>
> I don't want to setup my own build environment at the moment because I
> dont
> have the tools available now. I downloaded the PHP 5.0.3 Windows Binaries
> and want to know what options these Binaries were build with. How can I
> find
> out this? With phpinfo I didn't find this information.

phpinfo() lists the paramters used to compile PHP, so they *should* be
there, even under Windows, I think.

If not, do this:
php -i | grep GD

Either you see GD, or it ain't in there.

That said, under Windows, you just uncomment the php_gd.dll line in
php.ini and you're done.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] shell script - disable log output

2005-03-09 Thread Eli
Richard Lynch wrote:
I'm writing a shell script that uses error_log function to log some
data, but it echos the error message to the output without logging the
message to the log file.

"the log file"...
*WHAT* log file?
A shell script has no pre-determined log file, really.
Actually, it's almost for sure STDOUT at that point, or maybe STDOUT, but
I doubt it.  If you were coding PHP engine and needed to send error output
somewhere under shell circumstances, you'd think STDOUT would be "it"
right?...
So you can probably re-direct 2 (STDOUT) to somewhere to get the error_log
output where you want it.
I think in most shells that turns into:
test.php 2> /var/log/test
YMMV
It's up to you to figure out re-directs in your shell of choice.  Good luck.
You should probably use can use set_error_handler to trap errors -- though
that will not catch error_log output, I don't think.
You can also use set_error_reporting() to get rid of errors entirely,
though that's not recommended.
I don't really need it to log into a file, but I wanted to prevent it 
from echoing to the screen.

So I guess there's no way to prevent from error_log() (using defaults) 
to echo to the screen (STDOUT).
error_reporting() affects on errors produced by PHP itself. I tried to 
set it to 0 before the call, but it didn't help.
set_error_handler() affects on trigger_error() and not on error_log().

It seems that the extern lib I use should use trigger_error() (or 
user_error()) function instead, which is the traditional way to report 
user-defined errors.

Thanks for your help all...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagedestroy()

2005-03-09 Thread Richard Lynch
> Sorry if this is an old subject but it's new to me. I have a 'default'
> Fedora Core 1 installation of Apache2 v2.0.48 and php v4.3.8. I've
> noticed a problem in one of the scripts i had written a few months ago,
> but I was testing it on a Red Hat 8 system at the time and I'm not sure
> if the memory limit is default on that system or not. Anyway, what I've
> got is a script that is generating thumbnails from a batch of images in
> a directory, about 5000 images are being counted. While the script
> worked fine when i wrote  it a few months ago, on the different system,
> I was recently trying to use it and was repeatedly getting memory limit
> errors at an 8MB limit. What the script does is load an image in
> memory, create three different thumbnail sizes for the image,
> imagedestroy() is being called after each thumbnail build to kill the
> thumb, and then finally I'm calling imagedestroy() at the end of the
> iteration for that image to kill the original in memory before going on
> to the next image. What it appears to me is that imagedestroy() is not
> actually freeing the memory for use on the next cycle. While this
> doesn't really effect the scripts I have that are just generating
> thumbnails from a single image, the batch scripts I have are
> continually failing after about three iterations. I did increase the
> memory limit enough to get the script to finish, and php is apparently
> doing it's job in cleaning up when the script finishes so there's not a
> real threat to the server if I run the scripts during slow times. But
> it is a bit annoying that the function isn't working as it should. I
> noticed a few memory issues in the bugs pages relating to gd, and the
> resolution stated that it was a gd problem,  so I didn't want to bother
> the php maintainers with another one. What I'm wondering is if anyone
> else has noticed this behavior, and aside from increasing the memory
> limit, have you found an alternative? I'm really trying to keep the
> scripts I have portable, so I haven't looked at ImageMagic, but I was
> wondering if the shmop functions might be the way to go with this. I do
> have reservations about using that though since it's not a 'default' in
> the build and I have some servers that I have no control over the
> software side of things, and I am trying to make these as generic as
> possible. If you've gotten this far thanks, sorry it turned out to be
> so long, but this is a rather important problem in what I'm coding.

It's entirely possible that imagedestroy() works fine, but you've got some
*other* memory leak going on...



-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.0.3 and base64 encoded cookie value issue?

2005-03-09 Thread Richard Lynch

> Greetings,
>  I tested Richard's suggestion below, and it appears
> that 'urlencode' is not the function that I want.
>  Are there any other options? Does anyone know what
> PHP uses internally to 'munge' the cookie? I looked at
> the php.ini doc's and I could not find any option to
> turn off whatever 'encoding' PHP uses internally.

Hmmm.

Okay, show us some "before" and "after" values.

It's *GOT* to be something not unlike urldecoding if it changes + to space.

Damn!  PHP's urlencode might use %20 instead of + (or vice versa) so then
the urldecode and urlencode are not be true inverse functions, for
space/%20/+ scenarios.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ezmlm "bounced email" warnings - [was RE: [PHP] suspicious - maybe spam]

2005-03-09 Thread Richard Lynch
> Yeah, same here.  I thought it was my hosting service, but if other people
> are having the same issue then what's the deal?   Usually it's only a
> message or two, but sometimes it says there are like 8 or 9 messages that
> bounced.   Has anyone looked into this or have any information regarding
> this?

I did email my host and -owner for this list about it...

Not promising that will produce any action on either end.

While it seems to affect a lot of us, it doesn't seem to actually HURT
anything much, other than one more email to delete every few weeks.

A drop in the ocean, my friend.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP5.0.3 and pam authentication

2005-03-09 Thread Richard Lynch
> I'm trying to use pam_auth for a script.  It loads into php but it's not
> authenticating the users.  I'm using the correct password and username.
> This is a example of how I'm using the function:
>
> pam_auth($_POST[uname], $_POST[passwd], &$error)
>
> Any ideas? Thanks in advance

For starters, you should quote uname and passwd.

It's clear you also have error_reporting too low on your development
server, or PHP would complain about that.

You should not have the & in there.

Finally, according to the pam_auth FAQ, if you using a passwd or shadow
file, your user has to have read permission to read that file.  Seems like
the most likely reason for failure, based on what little info you give
us...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Quickform - edit form

2005-03-09 Thread Leonie \(phpgroup\)
DID YOU TRY THIS??

  echo "\n";
?>
Look! I just assigned data to the form!

Chris.
I'm using Pear Quickform (hence my subject title) with Smarty.  The 
value needs to be assigned to the Quickform object somehow.

Creating the field with:
$form->addElement('text', 'year', 'Year:');
How do I add the value?
Leonie
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Quickform - edit form

2005-03-09 Thread Leonie \(phpgroup\)
Richard Lynch wrote:
I always go for the "one form" system, because otherwise you have double
the work to do (opening two files) every little change, and invariably one
of the forms drifts out of sync when (not if, when) you forget to change
the other form and...
Thanks, Robert.  I think this is the best way too.  As the app I'm 
working on is still in development no doubt the form will be changing a 
few times.


Assigning data to the form mostly consists of using the VALUE= attribute
in HTML tags, except TEXTAREA where it goes between opening/closing tag.
Basic logic flow:

  $record_id = isset($record_id) ? $record_id : $_REQUEST['record_id'];
  if (...){ //detect some indicator that you want to "update" a reocrd
 $query = "update ...";
  }
  $query = "select ...  where id = $record_id";
?>

   //form data here

Yes, you display the form again with the data to edit, right after an insert.
That's by DESIGN, since it will help catch "ooops!" on data entry by
re-confirming with the user what they just did.  Better data entry is
good.
Thanks for that code.  It looks good.
I'm using Pear QuickForm (Pear DB for database) to create the forms, 
passing it to a Smarty template.  I'm just a bit stumped as to how to 
get the data into Quickform.

Snippet of field creation:
$form->addElement('text', 'year', 'Year:');
Leonie
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] software catalog

2005-03-09 Thread Richard Lynch

> Hey!
> Anybody know of a "software catalog" (or cart preferably) that is free?
>
> A site i am working for sells software, now they want to have a cart
> feature
> so people can put the packages in a cart and get discounts etc if they
> purchase more than 1 product...they are using 2checkout for processing.
>
> I checked the usual places and google of "php software cart" but got back
> garbled results, most of that carts are for tangible products :-(

This might have "sells intangibles" as a feature check point:

http://l-i-e.com/compare/index.htm?date=1970-01-01

Or you can add it and check back after some people "vote"

Disclaimer: I hacked this up after the umpteen flame war about PHP
Shopping Carts on this list in, oh, call it 2000 or so...  God only knows
which of those solutions is way out of date or whatever.  Caveat Emptor.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-09 Thread Richard Lynch
> Agreed, initially I thought of that but I also need to use transactions
> in my business logic and MySQL doesn't support nested transactions, so
> I'd have to open a separate connection to the DB to handle the session
> transaction while another connection handles the business
> transaction(s).  I'm hoping to find a solution that uses locking in the
> application level instead of the database.  Were I using a DB that
> supported nested transactions, it would be a different story.  maybe
> it's time to switch databases.

Since the data only changes when you write it, at the end of the script,
you could maybe get away with the transaction only being in the
session_save handler, and be sure to rollback or commit your business
logic before that.

That would for sure take a lot of discipline, and might even be downright
impossible for what you need, but it's worth pondering.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   >