hi, i got stuck at this piece of code for a while now. the proble is that it doesn't redirect to desired pages, but rather hangs up.
if ($user == 'journalist') {
$sql = "SELECT pass, login FROM members WHERE pass='$pass' and login='$login'";
$result = mysql_query($sql,$connection) or die ("no connection with the DB");
$num = mysql_numrows($result);
if ($num == 1) {
header('Location: journalists.php');
}
else {
header('Location: register_journalist.php');
}
}
else {
$sql = "SELECT pass, login FROM members WHERE pass='$pass' and login='$login'";
$result = mysql_query($sql,$connection) or die ("no connection with the DB");
$num = mysql_numrows($result);
if ($num == 1) {
header('Location: customers.php');
}
else {
header('Location: register_customer.php');
}
}
mysql_close($connection);
Any tips what may be wrong with it?
witold