我希望用户登陆不同的页面,如果登录成功则无效。请查看以下代码并就此问题向我提供帮助。
$result = mysql_query("SELECT * FROM users where EMAIL='$username' and PASSWORD='$password'", $link);
$num_rows = mysql_num_rows($result);
if ($num_rows==0)
echo "<h4><center>Invalid Username or password. Please <a href='login.php'>click here</a> to go back to Login page</center></h4>";
else
{
header('Location: http://xxxx/test.php');
}
请帮帮我。提前致谢
答案 0 :(得分:0)
试试这个:
header("Location: http://example.com/test.php");
die(); // end script execution here will "enable" above redirect
更详细地解释here