Home >Backend Development >PHP Tutorial >How to jump to the page before login in thinkphp after logging in?
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?
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>
<code> echo "<script>history.go(-1);</script>"; </code>