I'm trying to set up a script that checks an array of values sent by a web form for blanks and then reacts by telling the user to fill in the blanks. This is a part of the script that is giving me a problem:
//check the submitted fields for blanks
foreach ($HTTP_POST_VARS as $key => $value)
{
if ($key == "alias" or $key == "email")
{
if ($value == "" )
{
$blank_array[$key] = "blank";
}
}
};
//display error message if there are any blanks
if (@sizeof(blank_array) > 0)
{
echo "<b>You forgot to enter the following critical blanks:</b><br>";
foreach ($blank_array as $key => $value)
{
echo "{$label_array[$key]}<br>";
}
}
When I try to run this, I get an error saying that the last foreach statement in that section of code has an invalid argument. Why is this and how can I fix it? Thank you!