$url_game = 'http://wekings.ru';
$cookie = "_wk_session=BAh7CjoOcmV0dXJuX3RvSSJIaHR0cDovL3dla2luZ3MucnUvZ2FtZS9jYXB0Y2hhX3RyaWFsP2JhY2tfdXJsPSUyRmdhbWUlMkZhc3NpZ25tZW50cwY6BkVUOg9zZXNzaW9uX2lkSSIlMTNlMjhiZWZhNDYzNmY1MGEyMjA2NmIyOThkYzNkNTgGOwZGSSIKZmxhc2gGOwZUSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlMAY6CkB1c2VkewY7CUY6E3NpbXBsZV9jYXB0Y2hhSSItNzM3Mjg4NmRhODAyZGMwZDY0ZGQzMGQ5NjY1MmJlOGM5ZDdhYjJlMQY7BkY6CXVzZXJpA42ZOg%3D%3D--8759bcea866863cb40efaf119dae090e86e28c6c; remember_token=ce4152100dd4f9a50b5ab8468b3747dc;";
function curl($cookie, $url, $ref){
$header = array(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
'Accept-Encoding: gzip, deflate',
);
$curl = curl_init();
curl_setopt_array($curl, array (
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
CURLOPT_HTTPHEADER => $header,
CURLOPT_COOKIE => $cookie,
CURLOPT_AUTOREFERER => true,
CURLOPT_REFERER => $ref,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => true,
CURLOPT_URL => $url,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
));
$html = curl_exec($curl);
curl_close($curl);
return $html;
}
$t = curl($cookie, $url_game, $url_game) or die('Ошибка: 1');
$t1 = curl($cookie, $url_game.'/captcha_question/629', $url_game) or die('Ошибка: 2');
echo $t1;
//$img = file_get_contents($url_game.'/captcha_question/629');
//file_put_contents('nota.jpg', $img);
//echo '<img src="nota.jpg" />';