iGeek
12-28-2006, 04:35 PM
Okay. I want to be able to link to a script "redirect.php" with a query string, such as "redirect.php?http://www.google.com/" and have it redirect to Google, and so on. Basically it strips the URL from the URL and redirects the user to it. Am I making any sense?
Idiotic Creation
12-28-2006, 06:22 PM
hmm, is this what you mean?
url: redirect.php?url=http://www.google.com/
then php would be:
$url = $_GET['url'];
if (! header("Location: $url")) {
echo "Failed To Redirect, link here: <a href='$url'>$url</a>";
}
This will redirect them the the url in the address and if the redirect failed for some reason, it would provide them with a link.
I tested it on my site:
http://www.opticalmusic.net/redirect.php?url=http://www.google.com
Hope this helps,
David