I am processing my forms with a submit.php page. On the submit page, I would like to find a way to produce a message telling which form field they have forgotten to fill out. As it is, I am using this function to tell whether or not the form fields have been filled out. I would like to expand on this.
function filled_out($form_vars)
{
// test that each variable has a value
foreach ($form_vars as $key => $value)
{
if (!isset($key) || ($value == ""
)
return false;
}
return true;
}
I call it up like this:
if (!filled_out($HTTP_POST_VARS))
Then I return the error message. I tried to make an array of the HTTP_POST_VARS, but was unsuccessful (I'm pretty sure I did not write it correctly).
Any ideas?
function filled_out($form_vars)
{
// test that each variable has a value
foreach ($form_vars as $key => $value)
{
if (!isset($key) || ($value == ""
return false;
}
return true;
}
I call it up like this:
if (!filled_out($HTTP_POST_VARS))
Then I return the error message. I tried to make an array of the HTTP_POST_VARS, but was unsuccessful (I'm pretty sure I did not write it correctly).
Any ideas?