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

Programming, for all ages and all languages.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

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

Post 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?
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post 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.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

THANKS! That works perfectly!
Post Reply