RE: [PHP] $_POST bug?
| From: | Jake McHenry | Date: | Thu, 13 Nov 2003 09:04:16 +0000 |
| Subject: | RE: [PHP] $_POST bug? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-169454@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Eugene Lee [mailto:list-php-1@fsck.net]
> Sent: Thursday, November 13, 2003 3:48 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] $_POST bug?
>
>
> On Thu, Nov 13, 2003 at 12:59:11AM -0500, Jake McHenry wrote:
> :
> : > -----Original Message-----
> : > From: Jake McHenry [mailto:linux@nittanytravel.com]
> : > Sent: Thursday, November 13, 2003 12:53 AM
> : > To: php-general@lists.php.net
> : > Subject: [PHP] $_POST bug?
> : >
> : > I have 5 fields, all 1 character in length, numbers being
> : > entered. If zero's are entered in the boxes, and the form is
> : > submitted, the corresponding $_POST variables are empty? Is
> : > there a way around this, or am I doing something wrong?
> : >
> : > I guess I could just do, if (isset(... Blah.. Then if it's
> : > not set then manually set the variable name to 0...
> :
> : Just to test, I changed the input field length to 3, and
> every time I
> : tried it, single 0 does not create the $_POST variable. Double 0's
> : create it, along with any other numbers, it's only when a
> single 0 is
> : entered. Is this a bug or happening for a reason?
>
> In your form handler script, what does print_r($_POST) come out
with?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
print_r($_POST) shows me that $_POST has the single 0 value. I solved
my problem, instead of having just if ($_POST['test']), I changed it
to if ($_POST['test'] != ""). Right after I posted, I tried this, and
a couple other things.. The problem only happens when I don't have any
conditions within the ().
Thanks,
Jake McHenry
Nittany Travel MIS Coordinator
http://www.nittanytravel.com