Page 1 of 1

Redirection script not working properly - and I know why

Posted: Wed Dec 19, 2007 9:57 pm
by waradmin
I am trying to create a simple redirect script. It works in may cases, except for if the URL being redirected to contains a ?. That fails because the script looks for a URL after index.php?u=SOMEURL but stops when it reaches another question mark.

IE:

Code: Select all

http://someurl.com/?u=http://www.gooogle.com
redirects just fine, however this fails:

Code: Select all

http://someurl.com/?u=http://www.takemehere.com/index.php?page=home&cash=MONEY!
Is there a way to only read what is after the first ? (ie the $_GET['u'] value) and capture the entire thing, and not stop at the next ? or & symbol? I feel noobish asking all these questions but I busted out the php books and found nada.

Posted: Wed Dec 19, 2007 10:07 pm
by John Cartwright