views:

149

answers:

2

I want the the url of the page from which a request has been made. How can I do that in PHP?

+2  A: 

The refer(r)er can be found in the $_SERVER global variable. Please note that sending the refer(r)er is completely optional and a user-agent can simply decide to not send the refer(r)ing url.

$_SERVER['HTTP_REFERER']
Stefan Gehrig
+1  A: 

$_SERVER['HTTP_REFERER']

More here.

TFM