如何重定向/调度在PHP?
这个问题在这里已经有了答案:
使用这样的标题功能:
header('Location: login.php');
exit;
但是在调用头函数之前不要打印任何html输出,否则会导致错误。
尝试这样的事情:
<?php
session_start();
//do some login processing
if(login === true){
    exit(header('Location: home.php'));
}else{
    //Extra marks set a reason why failed
    $_SESSION['error'] = 'Some error about why it failed';
    exit(header('Location: login.php'));
}
?>
 exit(header('Location: *'));  是你以后的事情。 
 header('Location: http://someweb.com');  将重定向用户。 
