Home >Backend Development >PHP Problem >How to return to the previous level in php

How to return to the previous level in php

藏色散人
藏色散人Original
2021-11-24 09:18:515627browse

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.

How to return to the previous level in php

#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(&#39;随便写点什么&#39;);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!

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