我得到执行成功的消息,但它不是重定向到的网页出现错误:PHP和卷曲通过PHP代码登录到网站
Forbidden: You don't have permission to access /myaccount.php on this server.
代码:
$username ='[email protected]';
$password ='******';
$loginUrl1 ='http://www.zopnow.com/myaccount.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $loginUrl1);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS,"email=$username&password=$password");
// to ignore all cookies using libcurl
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
$store1= curl_exec($ch);
echo "Executed Successfully with loginUrl1 ".$store1;
curl_close($ch);
是否从实际的浏览器表单登录后工作? – GordonM 2014-10-17 07:57:30