Home >Backend Development >PHP Problem >php jump back to previous page

php jump back to previous page

coldplay.xixi
coldplay.xixiOriginal
2020-08-28 15:30:254398browse

How to jump back to the previous page in php: 1. Use the header function, the code is [header(location: the path of your previous page);]; 2. Use js to jump, the code is [ javascript:history.back(-1);].

php jump back to previous page

Related learning recommendations: php programming(Video)

How to jump back to the previous page in php:

3 effective methods for php to implement the function of returning to the previous page

Use header function:

header(location:你的上一页的路径);

// Note that there can be no output before this function

header(location:.getenv("HTTP_REFERER"));

// Return to its calling page

echo"<script>alert(&#39;随便写点什么&#39;);history.go(-1);</script>";

below This is js

javascript:history.back(-1);

Relevant learning recommendations: js video tutorial, js tutorial (picture and text)

The above is the detailed content of php jump back to previous page. 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