当前位置:Gxlcms > PHP教程 > php如何实现登录成功后跳转页面

php如何实现登录成功后跳转页面

时间:2021-07-01 10:21:17 帮助过:60人阅读

php如何实现登录成功跳转页面跳转

首先将判断用户是否登录成功,如果登录成功则使用“header()”函数,将http请求头的“Location”设置为需要跳转的URL地址,然后使用函数“exit()”结束脚本即可。

header()函数

header() 用于发送原生的 HTTP 头。

header ( string $string [, bool $replace = true [, int $http_response_code ]] ) : void

使用示例

<?php
header('Location: http://www.example.com/');
exit;
?>

推荐教程:《PHP教程》

以上就是php如何实现登录成功后跳转页面的详细内容,更多请关注Gxlcms其它相关文章!

人气教程排行