Код: Выделить всё
$mail=""; $password=""; $cfile = 'cookies.txt'; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, "http://vkontakte.ru/login.php?m=1&email=$mail&pass=$password"); curl_setopt ($ch, CURLOPT_USERAGENT, "Opera/9.64 (Windows NT 5.1; U; ru) Presto/2.1.1"); $headers = array( 'Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1', 'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8', 'Content-Type: application/x-www-form-urlencoded', 'Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1', 'Accept-Encoding: deflate', 'Cookie2: $Version=1', 'Connection: Keep-Alive, TE', 'TE: deflate, gzip, chunked, identity, trailers'); curl_setopt($ch, CURLOPT_HTTPHEADER,$headers); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIEJAR, $cfile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cfile); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch,CURLOPT_ENCODING , "gzip"); echo $result = curl_exec($ch);