i'm making a very simple redirect script, because a forum i frequent does not allow active links. they don't like the fact that people can see the referring URL, so this will bounce the links off of my server. however, i have a problem.
here's what i have so far:
<?php
if(isset($_GET['url']))
{
header("Location: " . $_GET['url']);
}
else
{
echo "<html>\n<head>\n\t<title>active link redirect</title>
\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"dev/index.css\">\n";
echo "</head>\n";
echo "please supply a URL to forward to via the get variable 'url'.</html>";
}
?>
some of you can probably already tell what the problem is. when i put in a link with a '&' in it, my script will see it as part of my script's variables, and not as part of the url being passed to $_GET['url'].
what i would like to know is a way to make this work. one way i was thinking was to simply add all the other variables that get assigned into another variable along with the url variable, then use that as the header instead of just calling the $_GET variable. any input is appreciated.