Re: Redirection Question

From: Date: Tue, 22 Jul 2003 22:52:41 +0000
Subject: Re: Redirection Question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-156350@lists.php.net to get a copy of this message
The other methods suggested avoid that entanglement. Kevin "Beauford.2005" <beauford.2005@rogers.com> wrote in message news:001d01c3516a$730b4ed0$6401a8c0@p1... > Maybe I didn't explain enough. What if they come from b.php or c.php. > How do I automatically log what page they tried to access. So hard > coding login.php?next=a.php would only work for one page. > > TIA > > -----Original Message----- > From: Curt Zirzow [mailto:curt@zirzow.dyndns.org] > Sent: July 22, 2003 4:16 PM > To: PHP > Subject: Re: [PHP] Redirection Question > > > * Thus wrote Beauford.2005 (beauford.2005@rogers.com): > > Hi, > > > > I am trying to figure out how to redirect a user back to a page but > > not having much luck. > > > > For example: I click on a menu item on my site which goes to a.php. > > This file includes another file that determines if they are logged in > > or not. If not, they are sent to login.php using header(:Location: > > .... ). How would I automatically redirect them back to a.php after > > they have logged in successfully. I have tried using HTTP_REFERRER, > > but it isn't redirecting. > > You can use the HTTP_REFERRER, but i wouldn't depend on it, it isn't a > required header for the client. > > what you prolbably should do is when the arn't logged int, you can send > them to something like: > header('location: login.php?next=a.php'); > > Then on your login form add a hidden variable: > <input type="hidden" name="next" value="<?echo > $_GET['next']?>"> > > Finally when the user submits this form, and the user logs in > successfully you know that you need to redirect them to the a.php. > > HTH, > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#156350) next »