How to jump to the page before login in thinkphp after logging in?

WBOY
Release: 2023-03-02 13:44:02
Original
2190 people have browsed it

If you use $_SERVER['HTTP_REFERER'], the full path is given. After successful verification, redirect does not support full path jump, and the page before the user logs in has parameters, such as this http://localhost/a/jz /index.php/Home/Test/test.html?t=10311244 What to do in this situation?

Reply content:

If you use $_SERVER['HTTP_REFERER'], the full path is given. After successful verification, redirect does not support full path jump, and the page before the user logs in has parameters, such as this http://localhost/a/jz /index.php/Home/Test/test.html?t=10311244 What to do in this situation?

http://localhost/a/jz/index.php/Home/User/login?redirect=/Text/test.html

Save the URL in the session before logging in, take it out after completion, and then redirect

You use the redirect() function to redirect the full path

<code>redirect("http://google.com");</code>
Copy after login

<code> echo "<script>history.go(-1);</script>";  </code>
Copy after login
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