Home >php教程 >php手册 >Thinkphp返回上一页的实现方案

Thinkphp返回上一页的实现方案

WBOY
WBOYOriginal
2016-06-07 11:36:421304browse

在开发过程中,经常用到返回上一页的功能,在此我提供一个思路仅供参考,欢迎讨论

实现过程如下:
1)在common/function.php添加常量//当前页面的完整URL地址,用于操作返回上一页<br> defined('CURRENT_URL') or define('CURRENT_URL',base64_encode($_SERVER["REQUEST_URI"]));2)使用方法,在需要返回的链接处调用<a>添加收货地址</a>3)在跳转操作的页面中添加javascript代码<script><br /> var return_url = "{$Think.get.return|base64_decode}";<br /> if(return_url){<br /> //延时跳转<br /> setTimeout(function () { <br /> window.location.href = reurl;<br /> },1500);<br /> }<br /> </script>跳转链接使用了base64编码以避免pathinfo模式url参数冲突

AD:真正免费,域名+虚机+企业邮箱=0元

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