Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = "";
- $password = "";
- if(!file_exists("cookie")) {
- $rez = curl("http://vk.com");
- $i = strpos($rez, 'lg_h');
- $res0 = substr($rez, $i+13, 50);
- $i = strpos($res0, '/>');
- $lg_h = substr($res0, 0, $i-2);
- curl("http://login.vk.com/?act=login&email=".$username."&pass=".$password."&lg_h=".$lg_h);
- }
- function curl($url, $post = false) {
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
- 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');
- if ($post) {
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie");
- curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");
- $response = curl_exec($ch);
- curl_close($ch);
- return $response;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement