Reply to Re: Login via php code on an external page

Your name:

Reply:


Posted by Jerry Stuckle on 03/01/07 19:24

Andrea wrote:
> I'm doing some test with this script:
>
> $url = "http://xxx.yyyyy.com/test2.php";
> $vars = "utente=ut&pass=pw";
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
> curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
> // if ($method == 'POST') {
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
> // }
> $data = curl_exec($ch);
> curl_close($ch);
>
> echo $data;
>
> and I'm getting this error:
>
> HTTP/1.1 403 Forbidden Date: Thu, 01 Mar 2007 16:31:54 GMT Server:
> Apache Content-Length: 286 Connection: close Content-Type: text/html;
> charset=iso-8859-1
> Forbidden
>
> You don't have permission to access /test2.php on this server.
>
>
> The page test2.php has a simple echo for the 2 vars:
>
> echo $_POST['utente'];
> echo "<BR>";
> echo $_POST['pass'];
>
> What's wrong???
>

Offhand I would say you have the file requiring authorization in your
httpd.conf and/or .htaccess files.

Can you access the page through your browser?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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