Re: how to check the form filled all
| From: | Tom Rogers | Date: | Mon, 19 Jan 2004 08:29:15 +0000 |
| Subject: | Re: how to check the form filled all | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175001@lists.php.net to get a copy of this message | ||
Hi,
Thursday, January 15, 2004, 7:33:29 PM, you wrote:
SH> HI, i want to check if the user filled the all inputs in the form. So, I
SH> checked NULL and "" with this function in the post receiving script.
SH> -------------------------------
SH> function is_filled_out()
SH> {
SH> // test that each variabl has a value
SH> foreach($_POST as $key => $value)
SH> {
SH> if(is_null($value) || $value="")
SH> return false;
SH> }
SH> return true;
SH> }
SH> ---------------------
SH> but when I submit the form without putting any value, it returns 'true'.
SH> what's wrong with my code?
try
if(empty($val))
--
regards,
Tom