connectMySQL(); $cmd = $_POST["cmd"]; if ($cmd == "forgot") { $email = $_POST["forgot_email"]; if ($email == "") { $forgot_error_message = "Please specify an email address."; include ("tmpl/header.tem.php"); include ("tmpl/main-forgot.tem.php"); include ("tmpl/footer.tem.php"); exit; } $at_pos = strpos ($email, "@"); if ($at_pos === false) { $forgot_error_message = "You did not enter a valid email address."; include ("tmpl/header.tem.php"); include ("tmpl/main-forgot.tem.php"); include ("tmpl/footer.tem.php"); exit; } $check_sql = "SELECT email, password FROM sat_users WHERE email='$email'"; $res = MySQL_Query ($check_sql); $row = mysql_fetch_array ($res); $forgot_error_message = "Your password has been emailed to you."; include ("tmpl/header.tem.php"); include ("tmpl/main-forgot-done.tem.php"); include ("tmpl/footer.tem.php"); } else { include ("tmpl/header.tem.php"); include ("tmpl/main-forgot.tem.php"); include ("tmpl/footer.tem.php"); } $db->disconnectMySQL(); ?>