session_start();
$CookieId = isset($_SESSION["CookieId"]) ? $_SESSION["CookieId"] : (isset($_REQUEST["CookieId"]) ? $_REQUEST["CookieId"] : '');
if(empty($CookieId)){
die('CookieId was not provided');
}
$handle = file_get_contents("http://www.blackhillscustomtours.com/voucher.php?CookieId='$CookieId'");
$f=@fopen("somefile.php","a");
fwrite($f,$handle);
fclose($f);
btw are you sure you want to open the file in append mode ("a") instead of write mode ("w" - which empties the file before you write to it)??