March 2003 14:24
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Checking for empty values sent from a
form[Scanned]
You usually don't want spaces either
foreach($_POST as $val)
{
if(strlen(trim($val)) < 1)
// do what you want
}
"Rick Emery" <[EMAIL PROTECTED]&g
You usually don't want spaces either
foreach($_POST as $val)
{
if(strlen(trim($val)) < 1)
// do what you want
}
"Rick Emery" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> foreach($HTTP_POST_VARS as $val)
> if($val=="")
> {
> do something
> }
> - Original M
You can write a function and when using it in a script insert
$HTTP_POST_VARS as the argument:
function filled_out($form_vars) {
foreach ($form_vars as $key => $value) {
if (!isset($key) || ($value == "")) {
return false;
}
}
return true;
}
(I think this i
3 matches
Mail list logo