Wykonałem to tak:
$curl=curl_init("http://strona.pl/page/auth"); curl_setopt($curl,CURLOPT_HEADER,1); curl_setopt($curl,CURLOPT_USERAGENT,$_SERVER["HTTP_USER_AGENT"]); curl_setopt($curl,CURLOPT_REFERER,"http://strona.pl/page/auth"); curl_setopt($curl,CURLOPT_TIMEOUT,7); curl_setopt($curl,CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_COOKIEFILE, "C:\xampp\htdocs\cookies.txt"); curl_setopt($curl, CURLOPT_COOKIEJAR, "C:\xampp\htdocs\cookies.txt"); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $postVars); $dw=curl_exec($curl);
Niestety, skrypt wyrzuca mi, że podane dane są niepoprawne. Problem w tym, że dane, które podaję są właściwe, bo logowanie na stronie tradycyjnie odbywa się poprawnie. Co mógłbym poprawić, żeby zadziałało?