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>";
推荐学习:《PHP视频教程》
立即学习“PHP免费学习笔记(深入)”;
以上就是php怎么实现返回上一层的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号