当前位置:首页 > 建站笔记 > 正文

php怎么实现返回上一层

php实现返回上一层的实现方法:1、通过“header(location:xx);”实现;2、通过“header(location:.getenv("HTTP_REFERER"));”实现;3、使用“history.go(-1)”实现。

本文操作环境:Windows7系统、PHP7.1、Dell G3电脑。

php怎么实现返回上一层?

php实现返回上一页的功能的3种有效方法

header(location:你的上一页的路径);   //   注意这个函数前不能有输出    
header(location:.getenv("HTTP_REFERER"));   //   返回其调用页面  
echo"<script>alert('随便写点什么');history.go(-1);</script>";

发表评论