WEIRD...fopen couldn't open any http file while it's working fine with any local file.
I've tried the following:
__________________________________________________ ______
1.
Expand|Select|Wrap|Line Numbers
- $fp = fopen("D:\Software\\test.txt","r");
- while($data = fgets($fp, 400))
- echo $data;
- #--> Result OK
Expand|Select|Wrap|Line Numbers
- $fp = fopen("http://www.google.fr","r");
- while($data = fgets($fp, 400))
- echo $data;
- #--> Result: Warning: fopen() [function.fopen]: php_network_getaddresses: gethostbyname failed in C:\wamp\www\hotelGlobe\hotels_list4.php on line 4
- # Warning: fopen(http://www.google.fr) [function.fopen]: failed to open stream: No error in C:\wamp\www\hotelGlobe\hotels_list4.php on line 4
P.S: I've tried with PHP4 and PHP5 but in vain.Same result with file_get_contents().
Please advise.
Thx in advance!
Configuration: Windows XP
Internet Explorer 6.0