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;
精彩评论