Home  >  Article  >  Backend Development  >  ThinkPHP 注册后跳转到来路页面

ThinkPHP 注册后跳转到来路页面

WBOY
WBOYOriginal
2016-06-06 20:43:571409browse

注册页面跳转代码

<code> <h4>如果您还不是会员,请<a href="%7B:U('User/register')%7D" title="立即注册">立即注册</a>
</h4>
</code>

来路页面->登陆页面->注册页面
怎么注册成功后到来路页面,上面代码在登录页面中。

我是想在href 加入$_SERVER['HTTP_REFERER'] 就是不知道在{:U('User/register')}怎么加参数

回复内容:

注册页面跳转代码

<code> <h4>如果您还不是会员,请<a href="%7B:U('User/register')%7D" title="立即注册">立即注册</a>
</h4>
</code>

来路页面->登陆页面->注册页面
怎么注册成功后到来路页面,上面代码在登录页面中。

我是想在href 加入$_SERVER['HTTP_REFERER'] 就是不知道在{:U('User/register')}怎么加参数

U('Blog/cate',array('cate_id'=>1,'status'=>1))

生成Blog模块的cate操作 并且cate_id为1 status为1的URL地址

你需要新建一个变量。。
session('urlReferer','来路地址');
这个是在登陆页面方法中写入的

然后再注册成功的跳转方法中 this-success('注册成功',session('urlReferer'));就可以实现跳转到来路页面了。
关于this-success()方法可以查看
http://www.thinkphp.cn/topic/13988.html

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