Home  >  Article  >  Backend Development  >  怎么用代码返回前两页?(非JS方法)

怎么用代码返回前两页?(非JS方法)

WBOY
WBOYOriginal
2016-06-13 13:44:25999browse

如何用代码返回前两页?(非JS方法)
RT。
比如我有一个列表页面goods.php.我点击登录。跳转到login.php.在login.php输入好信息提交至act_login.php处理,登录成功后我本意是返回goods.php,但是返回上一页是login.php.求解

------解决方案--------------------
在login.php 页加个session

$_SESSION['HTTP_REFERER'] = $_SERVER['HTTP_REFERER'];


登录后返回$_SESSION['HTTP_REFERER']页即可。


不用session也行。登录页加个$_SERVER['HTTP_REFERER']; hidden的input。post过去就ok了。
或$_GET方式也行。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn