Forum Moderators: coopster
$myUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$queryString = $_SERVER['QUERY_STRING'];
echo "total url = $myUrl?$queryString";
and I type:
http://www.example.com/js/script.php?show=http://www.google.co.uk
into my web browser I was expecting http://www.example.com/js/script.php?show=http://www.google.co.uk to appear on the page, but it doesn't - all I get is:
http://www.example.com/js/script.php?
Where have I gone wrong?
Thanks
Mike
$myUrl = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$queryString = "";
foreach ($_GET as $k => $v) {
$queryString .= "&".$k."=".$v;
}
if (strlen($queryString) > 1) $queryString = "?" . substr($queryString, 1);
echo 'total url = '.$myUrl . $queryString;
[edited by: FiRe at 9:27 am (utc) on June 6, 2008]
I'm annoyed at that, I've spent over an hour wondering "what on earth?" and trying everything thinking my server might be broken. Damn spammers, have to waste my time putting up code to stop them and now waste my time because I can't keep track of all the spam prevention measures I've had to install!
Thanks anyway guys.