I have an PHP application which get the source code of HTML pages.
You input the URL and the source code is returned, but some sites are returning an error from file_get_contents() …
Warning: file_get_contents(http://en.wikipedia.org/wiki/Main_Page) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/content/m/a/t/matthewzammit/html/htmlparser/03/evaluate.php on line 442
[FONT=Arial]
[SIZE=2]line 442 is where the URL is read:
$htmlText = file_get_contents($url);
[/SIZE]
[SIZE=2]but when the error is return $htmlText remains empty
two sites which return this error are:
http://www.petsmart.com
and when using https:// sites, my parser keeps reading but returns nothing, not even an error:
any help is appreciated, or links for further reading, as I can’t find anything which is actually related.
thanks.
[/SIZE][/FONT]