I am trying to log in to the e-autopay website. However, I get an error of 500. I have already tried everything. Tell me, what is the error? Maybe someone can test the code. I am sure the decision is elementary.
Login and password valid
include_once('simple_html_dom.php'); function request($url,$post = 0){ $ch = curl_init(); $ref="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"; curl_setopt($ch, CURLOPT_URL, $url ); curl_setopt($ch, CURLOPT_HEADER, 1); $request = 'Host: giggle.e-autopay.com Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Origin: https://giggle.e-autopay.com Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded Referer: https://giggle.e-autopay.com/adminka/login Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4'; $split = explode("\n",$request); curl_setopt ($ch, CURLOPT_HTTPHEADER,$split ); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); curl_setopt($ch, CURLOPT_USERAGENT, $ref); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 400); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch,CURLOPT_COOKIEFILE,dirname(__FILE__).'/cookie.txt'); curl_setopt($ch,CURLOPT_COOKIEJAR,dirname(__FILE__).'/cookie.txt'); curl_setopt($ch, CURLOPT_POST, $post!==0 ); if($post) curl_setopt($ch, CURLOPT_POSTFIELDS, '_token='.urlencode($post).'&login='.urlencode('giggle').'&password='.urlencode('45ne6w')); $curl=curl_exec($ch); $data = new simple_html_dom(); $data->load($curl); $status = curl_getinfo($ch); var_dump($status); curl_close($ch); return $data; } $url = 'https://giggle.e-autopay.com/adminka/login'; $token = request($url,0); echo $token = $token->find('input[name=_token]',0)->value; echo request($url,$token);