Re: Solved Getting page with fopen
| From: | Martin Thoma | Date: | Thu, 25 Apr 2002 09:11:05 +0000 |
| Subject: | Re: Solved Getting page with fopen | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94525@lists.php.net to get a copy of this message | ||
Ah, it works with fsockopen:
$fp = fsockopen ("www.google.com", 80, $errno, $errstr, 30);
if (!$fp)
{ print "Fehler: $errstr ($errno)\n";
}
else
{ fputs ($fp, "GET / HTTP/1.0\r\nHost: $Url\r\n\r\n");
while (!feof($fp))
{ $sLine .= fgets ($fp, 4096);
}
}
fclose ($fp);