p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Capturing the URL


Message #1 by "Jon Shoreman" <jon.shoreman@b...> on Sun, 10 Feb 2002 22:41:51
Is it possible to capture the URL of a page within the PHP code in any way?



After calling a login page I want to return to the page the user was 

originally on. One method would be to use a java script and do a history.go

(-1), but that would require the user to refresh the page.

It would be nicer to just pick up the URL in it's entirety and pass it to 

the login page and then have that re-load the original page.

I *could* reconstruct the URL, but it would be easier if there is a simple 

command that will get it for me!
Message #2 by "Hermawan Haryanto" <hermawan@h...> on Mon, 11 Feb 2002 05:53:33 +0700
Hi,



Yes you can, just use $HTTP_REFERER

So.. saved the $HTTP_REFERER as a variable and walk it thorugh the login

process, after the login process is done then you can just simply redirect

user to that variable.



Thanks

Hermawan Haryanto

hermawan@h...







----- Original Message -----

From: "Jon Shoreman" <jon.shoreman@b...>

To: "beginning php" <beginning_php@p...>

Sent: Sunday, February 10, 2002 10:41 PM

Subject: [beginning_php] Capturing the URL





> Is it possible to capture the URL of a page within the PHP code in any

way?

>

> After calling a login page I want to return to the page the user was

> originally on. One method would be to use a java script and do a

history.go

> (-1), but that would require the user to refresh the page.

> It would be nicer to just pick up the URL in it's entirety and pass it to

> the login page and then have that re-load the original page.

> I *could* reconstruct the URL, but it would be easier if there is a simple

> command that will get it for me!




$subst('Email.Unsub').

>



Message #3 by "Jon Shoreman" <jon.shoreman@b...> on Mon, 11 Feb 2002 23:40:38
Top dollar....thanks :-)



> Hi,

> 

> Yes you can, just use $HTTP_REFERER

> So.. saved the $HTTP_REFERER as a variable and walk it thorugh the login

> process, after the login process is done then you can just simply 

redirect

> user to that variable.

> 

> Thanks

> Hermawan Haryanto

> hermawan@h...

> 

> 

> 

> ----- Original Message -----

> From: "Jon Shoreman" <jon.shoreman@b...>

> To: "beginning php" <beginning_php@p...>

> Sent: Sunday, February 10, 2002 10:41 PM

> Subject: [beginning_php] Capturing the URL

> 

> 

> > Is it possible to capture the URL of a page within the PHP code in any

> way?

> >

> > After calling a login page I want to return to the page the user was

> > originally on. One method would be to use a java script and do a

> history.go

> > (-1), but that would require the user to refresh the page.

> > It would be nicer to just pick up the URL in it's entirety and pass it 

to

> > the login page and then have that re-load the original page.

> > I *could* reconstruct the URL, but it would be easier if there is a 

simple

> > command that will get it for me!




> $subst('Email.Unsub').

> >

> 


  Return to Index