require_once "PEAR.php"; require_once "HTTP.php"; // get the domain name to run HTTP::head on $filename = "/usr/home/digs/liqme/head.temp"; $handle = fopen($filename, "r"); $domain = fread($handle, filesize($filename)); fclose($handle); // trim trailing whitespace $domain = trim($domain); // run the head command $result = HTTP::head("http://$domain"); // output the results if (PEAR::isError($result)) { echo "Error: " . $result->getMessage(); } else { echo "
"; $data = var_dump($result); echo ""; foreach ($data as $key => $val) { $text .= $key . ": " . $val . "\n"; } $temp_data = "head.txt"; $fh = fopen($temp_data, 'w') or die("can't open file"); fwrite($fh, $text); fclose($fh); } ?>