Login Redirect?
Moderator: General Moderators
Login Redirect?
Ok I have a login form in the navigation for my site. I want it so that whatever page a user logs in at, it will bring them back to that page after they log in. What do I need to do?
All this problem takes is a little creativity. 
Within the login form, add a hidden variable.
(with no space between the ? and >)
then a little bit of php code before the form
Then in the processing page, in the if statement that processes the database query, add the following code if the login was successful:
pardon my coding & organization, it's been a long day. 
Within the login form, add a hidden variable.
Code: Select all
<input type="hidden" value=" <?=$thispage? > ">then a little bit of php code before the form
Code: Select all
<?
$thispage = $_SERVER['PHP_SELF'];
?>Code: Select all
$jumpto = trim($thispage);
header("location: $jumpto");