Jump to content

why file_get_contents not work?


1965

Recommended Posts

Hi. All. I donot know why there are errors below. I tried several times but still can not work out. The url does really exist because I use it very day in ie. But if I use PHP code, it can not work. Please help.

 

<?php

$file = file_get_contents ('http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME');

Echo $file;

?>

 

 

In IE

Warning: file_get_contents(http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME): failed to open stream: HTTP request failed! in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

 

In IE

Warning: file_get_contents(http://ws.geonames.org/rssToGeoRSS?feedUrl=http%3A%2F%2Fhosted.ap.org%2Fl ineups%2FWORLDHEADS-rss_2.0.xml%3FSITE%3DRANDOM%26SECTION%3DHOME): failed to open stream: HTTP request failed! in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

 

In Opera:

Fatal error: Maximum execution time of 30 seconds exceeded in D:\wwwroot\guoshesen\wwwroot\map\rssxml.php on line 3

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.