Home  >  Article  >  Backend Development  >  登录成功后回到原来的页面并保持数据

登录成功后回到原来的页面并保持数据

WBOY
WBOYOriginal
2016-06-13 11:57:361904browse

登录成功后返回原来的页面并保持数据
当用户在未登录状态下发表帖子或评论时 点击提交后跳转到登录注册页面

  请问这里怎么实现登录或注册成功后返回到原来发帖的页面 并且保持帖子的内容 
------解决方案--------------------
用$_SERVER['HTTP_REFERER'] 获取来源地址。当登入成功后,你会把用户信息写入session。然后返回的地址使用
$_SERVER['HTTP_REFERER'] 就可以了。

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