My php runs trough a proxy and I have written the following code. The www.google.com page is read, but www.yahoo.com isn't. My question is how can i read both without writing fsockopen twice. pfsockopen doesn't work also. I have to open thousands of pages with the script and if i use open a socket for evrey page i'm opening after a few hundreds the proxy interrupts my connection.
$datei = fsockopen("cache.roedu.net", 3128, &$errno, &$errstr);
if( !$datei )
{
echo "proxy not available !";
fclose($resultfile);
exit();
} else {
fputs($datei,"GET http://www.google.com HTTP/1.0\n\n");
while(!feof($datei))
{
$linie=fget($datei,4096);
echo $linie;
}
fputs($datei,"GET http://www.yahoo.com HTTP/1.0\n\n");
while(!feof($datei))
{
$linie=fget($datei,4096);
echo $linie;
}
}