Answer the question
In order to leave comments, you need to log in
Unable to log in with curl, why?
Hello. I'm trying to log in to the site using curl php (website on Bitrix) but I can't
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.site.ru/login/' );
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/32.0.1700.107 Chrome/32.0.1700.107 Safari/537.36');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookie.txt');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'user'=>'[email protected]',
'password'=>'pass'
));
curl_exec($ch);
curl_close($ch);
#HttpOnly_.www.site.ru TRUE / FALSE 0 PHPSESSID 8i9thdlnkjeo50dleiffigb6lh
Answer the question
In order to leave comments, you need to log in
It is necessary to study all POST / GET requests, there can be no answer without this.
For example, there may be a scripted captcha that you do not take into account, but it is displayed and taken into account in requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question