Re: Can a website block the use of file_get_contents ?



On 28 Mar, 10:03, postseb <post...@xxxxxxxxx> wrote:
Can a website block the use of file_get_contents ?

Example : file_get_contents("http://www.google.com";) works fine, but
file_get_contents("http://www.petitscailloux.com/Follow.aspx?
sUrl=http://www.seloger.com/199986/16271207/detail.htm";) does not.

Any clues or ways to circumvent ?



Well, its not a valid URL for starters - you should urlencode
everything after the 'sURL=' and lose the white space in front.

If that still does not work, try using curl with a faked user agent -
maybe they serve up different content to different browsers.

But beware - if the remote site has anti-leech functionality you
should respect the publishers constraints.

C.

.



Relevant Pages