Hi,
I have a common function that checks that all form fields have been completed before saving the data.
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;
}
This has worked fine in the past, but now when I call it from the following script it keeps returning an error message depite all fields having been completed.
if (!filled_out($HTTP_POST_VARS))
{
echo "You have not completed all required fields - please go back and try again.";
do_HTML_URL("createprod.php", "Go Back");
exit;
}
Does anyone have any ideas? I can't see anything wrong with this.
Cheers, Jo