Anyone see whats wrong here? After I try to login and the script checks my account from the one in mysql it should go and set a cookie then redirect me to index2.php but no go...
//Check for user errors
if ($_REQUEST["Submit"] == "Login") {
if ($_REQUEST["mail"] == "" || $_REQUEST["pass"] == "") {
echo "<center><b>Field was left Blank!</center></b><br>";
form($_REQUEST["mail"]);
echo "<br><br>";
return;
}
// Database Connection String ------Start------
$connect = mysql_connect("localhost", "root", "") or die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
$db = mysql_select_db("ko", $connect) or die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
$sql = "SELECT * FROM AO_Members WHERE AO_Email='".$_REQUEST["mail"]."' and AO_Password='".md5($_REQUEST["pass"])."'";
$sql_result = mysql_query($sql, $connect) or die ("<b><center>".mysql_errno().": ".mysql_error()."</b></center>\n");
// Database Connection String ------End------
if (mysql_num_rows($sql_result) == 0) {
//Error Show Login Again!
echo "<p align='center' class='links'>You do not have access to these pages!<br>Please Try Again!</p>";
//Load Login Form
form($_REQUEST["mail"]);
echo "<br><br>";
return;
} else {
//Set Cookies
setcookie ("ko[0]", $_REQUEST["mail"], time()+7200);
setcookie ("ko[1]", md5($_REQUEST["pass"]), time()+7200);
header("Location: index2.php"); /* Redirect browser */
return;
}
//Close Database Connection
mysql_close($connect);
return;
}
any ideas?