Variables are not interpolated when in single quotes. Use double quotes:
$myURL = "http://$_SERVER['HTTP_HOST']$_SERVER['REQUEST_URI']";
Or, for clarity:
$myURL = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$myURL = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$myURL = sprintf("http://%%",$_SERVER['HTTP_HOST],$_SERVER['REQUEST_URI']);