开发者

Redirect to login page

I want to make login page, another php page ha开发者_高级运维ndles the request, I want t check the validity of credential info, in a case that user name or pswd is not correct, I want to make redirection to login page, HOW can I make redirection in php ??


Redirection in PHP is easy. Just make sure not to print out any HTML before you do it:

header('Location: http://www.example.com/');


You want to use 'header()':

header('Location: /login.php');

Reminder that no data can be printed to the screen before a header() is called.


header('Location: /path/page.php'); and exit;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜