Code: Select all
$op = fsockopen($_SERVER['HTTP_HOST'], 80);
if (!$op) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($op, "GET ". $URL . "\r\n\r\n");
if ($dispoutput) { while (!feof($op)) { echo fread($op, 1024); } }
fclose($op);
}So the questions are:
Do you spot any possible problem with the above fsockopen code that could result in low reliability (I think it has something to do with incorrent connection closing but that could be pure speculation).
Do you know how to accomplish the same thing with CURL?
Thanks!
Tomas