I've been playing around with fopen and reading from files remotely. However, I have found a few quirks and can only hyphothesise as to the problems...
For instance, I can open the following URL and read from it successfully with no problems what-so-ever...
http://www.goodguys.com/adtemplate.asp?invky=307271&catky=733455
If I try to open another valid url on that same site I can not open it. If I try I get the error:
Warning: fopen("http://www.goodguys.com/sony/sony_adtemplate.asp?invky=971220&catky=733455","r") - No error in c:\inetpub\wwwroot\hdtvpub\getinfo\2.php on line 12
Fatal error: Maximum execution time of 30 seconds exceeded in c:\inetpub\wwwroot\hdtvpub\getinfo\2.php on line 12
Code:
Line 12: $file = fopen ("http://www.goodguys.com/sony/sony_adtemplate.asp?invky=971220&catky=733455", "r");
Line 13: if (!$file) { echo "<p>Unable to open remote file.<BR>\n"; }
This I do not understand at all. Why can I see this page in Internet Explorer with no URL forwards or anything else, but PHP can not read it? It seems it is just sitting there.
Another strange thing is with the site 800.com. Anytime I try to open a URL on their site (http://www.800.com/prod.asp?P=5261) I get the following error:
Warning: fopen("http://www.800.com/prod.asp?P=5261&","r") - No error in c:\inetpub\wwwroot\hdtvpub\getinfo\2.php on line 12
Unable to open remote file.
This is different because it does not time out, but just acknowledges that it can not open the file and keeps going.
Still, however, why is PHP not able to see/open this file when that URL will work in my browser?
Any ideas why I can not open and read from some sites while I can read and open from many others?
Any help apprecaited!
Rebies