Code: Select all
$fp = fsockopen($domain, 80, $errno, $errstr);
if (!$fp) { echo "$errstr ($errno)<br>\n"; } else {
$out = "GET ".$_SERVER['PHP_SELF']."?com=cache&pass=$password HTTP/1.1\r\n";
$out .= "Host: $domain\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)){
echo fgets($fp,32000);
}What I'd like to do is to 'force' the server to send the GET request, finish the job on the server and then notify me via email (for example) when the job is done. The reason for this is that the "cache" command can take several hours to finish.
I hope I explained it good enough... The point is, the work should be done "silently" on the server just like if the code was executed through Cron job.
Thanks!
Tomas