Home > Backend Development > PHP Problem > How to jump to the previous page in php

How to jump to the previous page in php

藏色散人
Release: 2023-03-06 09:34:01
Original
2125 people have browsed it

How to implement php to jump to the previous page: 1. Use the "history.back();" method to realize the jump; 2. Use the "javascript:window.location.hre" method to realize the jump; 3. , use the "location.href" method to jump to the previous page.

How to jump to the previous page in php

Recommended: "PHP Video Tutorial"

php implementation to return to the previous page

//php实现返回上一个页面不刷新
<?php
    echo "<script>alert(&#39;退出成功!&#39;);history.back();</script>";
?>
 
 
//返回上一个页面并刷新,只是吧当前页面的url替换成上一个页面而已
</php
    echo "javascript:window.location.href=document.referrer;";
?>
//或者
echo "<script>alert(&#39;退出成功!&#39;);location.href=&#39;".$_SERVER["HTTP_REFERER"]."&#39;;</script>";
Copy after login

The above is the detailed content of How to jump to the previous page in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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