ok then well theres two ways to do this then...
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING'];
echo $url;
this will always assume there is arguments in the address so u will always see a question mark int the address, a better way of doing this would be to test if there actually was any arguments before just adding the question mark such as in this example:
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
if (!empty($_SERVER["QUERY_STRING"]))
$url .= "?".$_SERVER['QUERY_STRING'];
echo $url;
i hope this answers any questions you do have