";
}
}
// check for valid email
if (!isValidEmail($_SESSION['email']))
{
$_SESSION['errors'] .= " - Invalid email address
";
}
// if all fields OK
if ($_SESSION['errors'] == "")
{
// create an entry in the log file
$_SESSION['date'] = date('m/d/y H:i:s');
$logfile = "../../logs/SchoolGuideDownloads.txt";
$fp = fopen($logfile, "a");
foreach($allfields as $field) {
fwrite($fp, $field . '="' . $_SESSION[$field] . '" ');
}
fwrite($fp, "\r\n");
fclose($fp);
// display success page
header("Location: schoolGuideformFinish.htm");
exit;
}
}
else
// first time through - Submit button not pressed
{
$_SESSION['errors'] = "";
$_SESSION['state'] = "";
$_SESSION['country'] = "United States";
}
?>
|