Re: how to check the form filled all

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Arijit Chaudhuri wrote:

$value="" should be $value==""?

Regards,
Arijit

"Sungpill Han" <hansungpil@xxxxxxxxx> wrote in message
news:20040115093322.7626.qmail@xxxxxxxxxxxxxxx

HI, i want to check if the user filled the all inputs in the form. So, I
checked NULL and "" with this function in the post receiving script.
-------------------------------
function is_filled_out()
{
// test that each variabl has a value
foreach($_POST as $key => $value)
{
 if(is_null($value) || $value="")
  return false;
}
return true;
}
---------------------
but when I submit the form without putting any value, it returns 'true'.
what's wrong with my code?

Yes, It's $value==""
hmm, about the second part, no sure about it, maybe just with making the variable equal to an empty string stops being null, (as in C, if you create the variable you're already using memory, but as far as I know, this prog isn't exactly working with pointers...)



Leo.


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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux