Click to See Complete Forum and Search --> : Getting the current URL in PHP


sc_king
11-07-2007, 11:23 PM
Is there a function to grab the current URL.

I have a list with a function which only works when logged in. After logging in I want to redirect them back to the page they were on.

Any ideas?

Can't work with GET or POST since it's being passed more than once. It gets kinda messy.

scragar
11-08-2007, 12:19 AM
http://uk3.php.net/reserved.variables

$_SERVER['PHP_SELF']

that's a relative path, so you'll need to add your sites domain name to the front.