|
Posted by Rik Wasmus on 10/25/07 19:02
On Thu, 25 Oct 2007 16:46:07 +0200, Taras_96 <taras.di@gmail.com> wrote:=
> Hi everyone,
>
> The output of
>
> echo file_get_contents("http://watchout4snakes.com/creativitytools/
> RandomWord/RandomWordPlus.aspx");
>
> leaves the browser empty.. no error messages, nothing.
>
> Why is this occurring?
It's a badly designed website/server, which apparently applies browser =
sniffing of some sort. You'll have to mimique a common UA with for =
instance CURL to get it to output anything. This works:
<?php
$ch =3D curl_init();
curl_setopt($ch, CURLOPT_URL, =
"http://watchout4snakes.com/creativitytools/RandomWord/RandomWordPlus.as=
px");
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT =
5.2; en-GB; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');
curl_exec($ch);
curl_close($ch);
?>
... without setting the CURLOPT_USERAGENT the site indeed outputs nothing=
..
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|