Im trying to write a query to verify that a given user id and email address are indeed associated with each other. I have succeeded as long as the user id IS in the database. Im having trouble when the given user id is not a valid user id. When the form is submitted and the user id is not in the database, the browser is going to a blank screen. code is below…
[php]
$userid = $_POST[‘nar’];
$email = $_POST[‘mail’];
$con = mysql_connect(“localhost”, “some_db”, “password”);
mysql_select_db($database) or die( “Unable to select database”);
$result = mysql_query(“SELECT * FROM table
WHERE uid=’$userid’”);
while($row = mysql_fetch_array($result)){
IF ($row['mail']==$email && $row['narid']==$narid){
header('Location: http://www.webpage.com/=verified');
} else {
header('Location: http://www.webpage.com/=not_verified');
}
}
mysql_close();[/php]
any help would be greatly appreciated, im pulling my hair out.