donglu5041
donglu5041
2011-03-25 14:03

特定URL上的file_get_contents

已采纳

I have a specific URL which I cannot retrive the source code from using file_get_contents.

Can anyone help me get the source code of the URL below or does anyone have an idea why it does not work on that specific URL?

The URL is: http://www.lectio.dk/lectio/285/SkemaNy.aspx?type=elev&elevid=1628118635

The following returns nothing.

$source = file_get_contents('http://www.lectio.dk/lectio/285/SkemaNy.aspx?type=elev&elevid=1628118635');
echo $source;
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • dtsfnyay300457 dtsfnyay300457 10年前

    This was an error at my host which is now solved. I am sorry for wasting your time but I am glad that you wanted to help.

    点赞 评论 复制链接分享
  • dpnhp20440 dpnhp20440 10年前

    I'd say that the site generates it's contents with javascript so thats the reason you can't get the contents.

    点赞 评论 复制链接分享
  • dongyi2534 dongyi2534 10年前

    I'm guessing you share the same host as that site, and you use some sort of NAT/SAT mapping between internal and external IP.

    Your server resolves www.lectio.dk into 257.34.23.1 but the actual internal IP of your server is 10.4.5.101.

    Your server isn't aware of the external IP because the firewall can't connect to it's own external IP like that (it's possible to configure though).

    Solution:

    add www.lectio.dk into your hosts file and have it map to your internal IP.

    点赞 评论 复制链接分享

相关推荐