Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.     $username = "";
  3.     $password = "";
  4.     if(!file_exists("cookie")) {
  5.         $rez = curl("http://vk.com");
  6.         $i = strpos($rez, 'lg_h');
  7.         $res0 = substr($rez, $i+13, 50);
  8.         $i = strpos($res0, '/>');
  9.         $lg_h = substr($res0, 0, $i-2);
  10.         curl("http://login.vk.com/?act=login&email=".$username."&pass=".$password."&lg_h=".$lg_h);
  11.     }
  12.     function curl($url, $post = false) {
  13.         $ch = curl_init($url);
  14.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  15.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  16.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  17.         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  18.         curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 AlexaToolbar/alxg-3.1');
  19.         if ($post) {
  20.             curl_setopt($ch, CURLOPT_POST, 1);
  21.             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  22.         }
  23.         curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie");
  24.         curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");
  25.         $response = curl_exec($ch);
  26.         curl_close($ch);
  27.         return $response;
  28.     }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement