Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ru; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4");
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 15);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_URL, 'http://novafilm.tv/auth/login');
- $boundary = "----WebKitFormBoundaryRQ3KHJbpfmPf11v6";
- $data = "--{$boundary}
- Content-Disposition: form-data; name=\"return\"
- /auth
- --{$boundary}
- Content-Disposition: form-data; name=\"username\"
- {$log}
- --{$boundary}
- Content-Disposition: form-data; name=\"password\"
- {$pass}
- --{$boundary}
- Content-Disposition: form-data; name=\"login\"
- Хочу войти!
- --{$boundary}--";
- $header[] = "Content-Type: multipart/form-data; boundary=".$boundary;
- $header[] = "Content-Length: ".strlen($data);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- $result = curl_exec($ch);
- curl_close($ch);
- return $result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement