|
|
Posted by Andrea on 03/01/07 16:56
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???
Navigation:
[Reply to this message]
|