Page 1 of 1

PHP-How to get the "end" of the URL?

Posted: Sun Jul 29, 2007 9:17 am
by earlz
Ok, I am makign a little security thing, and I need to be able to basically get the entire GET string, but I need it just how it is in the user's browser url. This is so that I can redirect to that exact url when they are logged in..

How can I go about doing that?

Posted: Sun Jul 29, 2007 9:58 am
by frank
I think that you could use $_SERVER['REQUEST_URI'] which gives you the entire address line after the domain name ie

Code: Select all

http://www.google.com/seach?something=something
would give

Code: Select all

/search?something=something
Then you could just look for the question mark and the rest of the string would be the GET parameters.

Posted: Sun Jul 29, 2007 10:41 am
by earlz
THANKS! That works perfectly!