On Wed, Jul 21, 2004 at 03:15:51AM +1000, Howard Lowndes wrote:
> I am trying to test the status of a value passed to a PHP program as a
> POST parameter, specifically a SUMBIT button, thus:
> 
> if (empty($_POST['button'])) {....
> 
> Now, I know that the parameter is not empty because if I put a debug
> print line before it then it will print out the value of the parameter
> and the conditional test comes up as false, which it should, thus:
> 
> print $_POST['button'].'<br>';
> if (empty($_POST['button'])) {....
> 
> but if I don't have the preceding print statement (which is only in
> there as a debug) then the conditional test comes up as true and the
> logic branches off in the wrong direction.
> 
> BTW, it's PHP 4.2.2 called by Apache 2.0 on a 2.4.20 kernel.
> 
> As I say, really weird, and even weirder is that I have another program
> with identical logic in this same way that behaves fine.

I'll bet pounds to peanuts you've typo'd the index name on the empty() call. 
Is the code above a direct cut-n-paste from your code, or a retype?

- Matt
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to