Code: Select all
$fp = fsockopen($domain, 80, $errno, $errstr);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
$out = "GET ".$_SERVER['PHP_SELF']."?com=cache HTTP/1.1\r\n";
$out .= "Host: $domain\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
if ($res) { while (!feof($fp)) { echo fread($fp, 1024); }}
fclose($fp);
}I suppose I can simply count the number of cache files with glob or something similar but that's not always the best idea (e.g. I'd have to delete all old cache files before executing this function etc.).
I haven't used fsockopen before so I may be missing something obvious.
As always, any ideas are welcome!
Tomas