Re: Not understanding HTML form [message #169440 is a reply to message #169434] |
Mon, 13 September 2010 10:44 |
Piyush Gupta
Messages: 6 Registered: September 2010
Karma:
|
Junior Member |
|
|
On Sep 12, 11:52 pm, Marious Barrier <marious.barr...@gmail.com>
wrote:
> On 09/12/2010 02:25 PM, MikeB wrote:
>
>
>
>
>
>> On Sep 12, 1:17 pm, Marious Barrier<marious.barr...@gmail.com> wrote:
>>> On 09/12/2010 02:06 PM, MikeB wrote:
>
>>>> However, on a 3rd iteration, without typing anything into any field,
>>>> the isset still evaluates to true, although the $_POST variable for
>>>> "action' shows a null field. How can I then recognize that that field
>>>> is in fact not set? or is it set with nulls or what is going on here?
>
>>> Isset will evaluate to false only when a variable is a *PHP* null or it
>>> is not set. (null anyway too)
>
>> OK, I see it now. If I never enter a value in that field, on a 2nd
>> iteration, the isset() will also evaluate to true. so it does not
>> matter if I ever enter a value, just the fact that the form returns a
>> "null" value means the field is actually set for PHP. I guess I can
>> use the PHP function unset() to delete the variable from the array?
>
> Nah, don’t do unnecessary things.
>
>> Hmmm back to the drawing board....
>
>> This stuff is hard and complicated. :(
>
> Not really, just do this.-
>
> Check if isset($_POST['nameofthepost'])
> or just count($_POST) to check if there is any post at all.
> and... check the data sent with strlen(). remember, everything sent on
> posts appears as strings in the server. You must transform them into
> whatever you might need.
>
> And remember, always filter... never trust the client’s input.
Hi ,
We at www.rntlabs.com [RNTLABS Software Solutions] have exciting
openings for the below
1/ PHP
2/ Designers
3/ Android
4/ iPhone
5/ QA
6/ ROR
Please apply at hr(at)rntlabs(dot)com ASAP .
Thanks
Piyush Gupta
|
|
|