我正在尝试根据来自其他页面的用户输入重定向。或者我希望他们能够根据他们的输入查看特定文件。首先是根据输入将它们引导到特定网页的代码。
<?php
$user1=999;
$user2=100;
$user3=200;
$account=$_POST["account"];
if ($account==$user1)
{
header('Location: http://menu.html');
}
elseif ($account==$user2)
{
header('Location: http://services.html');
}
elseif ($account==$user3)
{
header('Location: http://about.html');
else
{
echo "this don't work";
}
?>
编辑 - 我在这个帖子中尝试了所有的回复和评论,但我仍然遇到同样的问题。输入数字后我唯一得到的就是空白页。
答案 0 :(得分:0)
header('Location: /menu.html');
exit;