php implementation method of returning to the previous layer: 1. Implemented through "header(location:xx);"; 2. Implemented through "header(location:.getenv("HTTP_REFERER"));"; 3. Use "history.go(-1)" to implement.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
How to return to the previous level in php?
3 effective methods for php to implement the function of returning to the previous page
header(location:你的上一页的路径); // 注意这个函数前不能有输出 header(location:.getenv("HTTP_REFERER")); // 返回其调用页面 echo"<script>alert('随便写点什么');history.go(-1);</script>";
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to return to the previous level in php. For more information, please follow other related articles on the PHP Chinese website!