file_get_contents on specific URL
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/Sk开发者_运维技巧emaNy.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;
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.
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.
I'd say that the site generates it's contents with javascript so thats the reason you can't get the contents.
精彩评论