have a question, I need to validate form information against a list, if one of the fields contains a string that isn't in the list the script needs to abort with an error message. For some reason this isn't working, been trying it with strpos but that doesn't seem to work, anyone have any suggestions? the code is following behind the cut.
// when called checks to make sure $email is in the array $elist, sets $continue to TRUE if it is.
function checkEmail()
{
if (strpos($elist, $email))
{$continue = "TRUE";}
}
// prints the opening tages for the HTML page
function htmlSetup()
{
print("<HTML>");
}
// prints the ending tags for the HTML page
function html2()
{
print("</html>");
}
// configures the email addresses in the $elist array
$elist[] = "test1@gere.net";
$elist[] = "test2@gere.net";
$elist[] = "test3@gere.net";
// checks to make sure the email address submited is in the $elist array
checkEmail();
if ($continue == "TRUE")
{
if ($email)
{
htmlSetup();
print("");
html2();
}
}
else
{
htmlSetup();
print("Input not valid, please notify the appropriate person.");
html2();
}
?>
