You are here: Re: Curl gives 403 forbidden « PHP Programming Language « IT news, forums, messages
Re: Curl gives 403 forbidden

Posted by Jacob Atzen on 08/28/05 13:18

On 2005-08-26, Basta <baspellis@gmail.com> wrote:
> I'm trying to retrieve information of a website using PHP and Curl.
> This is the code I use:
>
><?
> $tturl = "http://teletekst.nos.nl/";
> echo "opening $tturl ...\n";
> $ch = curl_init();
> if (! $ch) die( "Cannot allocate a new PHP-CURL handle\n" );
> $fp = fopen("ttread.htm", "w");
> curl_setopt($ch, CURLOPT_FILE, $fp);
> curl_setopt($ch, CURLOPT_URL, $tturl);
> curl_exec($ch);
> curl_close($ch);
> fclose($fp);
> echo "finished\n";
> ?>
>
> This results in a 403 forbidden page. However if I type the url
> http://teletekst.nos.nl/ in my browser then it works fine (also with
> cookies disabled). If I change $tturl in the script to
> http://www.nos.nl/ itw works. What is teh difference between typing
> itin my browser or accessing it with curl? Is tehere a workaround for
> this?

Perhaps it checks on user-agent?

--
Cheers,
- Jacob Atzen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация