Firstly its not actually a HTML page its being sent to. More than likely the site is configured with .html to be parsed as what ever server side programming engine they have running.
Secondly using your example
<?php
echo (isset($_GET['varname']) ? "Your QueryString was: " . $_GET['varname'] : "Try: ht."".tp://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?varname=something");
?>
Take the ."". in the ht and tp vB is trying to parse it as a URL