"; // make mysql connection + select db include("connect_sub.inc"); // test user // select all $query = mysql_query("SELECT * FROM Login") or die("No Query"); $auth=0; // testing loop while ($record = mysql_fetch_array($query)) { if ($user == $record[User]) { // test pass if ($pass == $record[Pass]) { // pass $auth = 1; } else { //password incorrect } } else { //User incorrect } } } else { // no cookie found $auth=0; } ?>