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

php jump back to previous page

coldplay.xixi
Release: 2023-03-05 12:04:01
Original
4362 people have browsed it

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:你的上一页的路径);
Copy after login

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

header(location:.getenv("HTTP_REFERER"));
Copy after login

// Return to its calling page

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

below This is js

javascript:history.back(-1);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template