Advertisement
Guest User

Untitled

a guest
Feb 25th, 2011
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1.     $ch = curl_init();
  2.     curl_setopt($ch, CURLOPT_POST, 1);
  3.     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");
  4.     curl_setopt($ch, CURLOPT_HEADER, 1);
  5.     curl_setopt($ch, CURLOPT_TIMEOUT, 15);
  6.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7.     curl_setopt($ch, CURLOPT_URL, 'http://novafilm.tv/auth/login');
  8.     $boundary = "----WebKitFormBoundaryRQ3KHJbpfmPf11v6";
  9.     $data = "--{$boundary}
  10. Content-Disposition: form-data; name=\"return\"
  11.  
  12. /auth
  13. --{$boundary}
  14. Content-Disposition: form-data; name=\"username\"
  15.  
  16. {$log}
  17. --{$boundary}
  18. Content-Disposition: form-data; name=\"password\"
  19.  
  20. {$pass}
  21. --{$boundary}
  22. Content-Disposition: form-data; name=\"login\"
  23.  
  24. Хочу войти!
  25. --{$boundary}--";
  26.  
  27.     $header[] = "Content-Type: multipart/form-data; boundary=".$boundary;
  28.     $header[] = "Content-Length: ".strlen($data);
  29.     curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  30.     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);   
  31.     $result = curl_exec($ch);
  32.     curl_close($ch);
  33.     return $result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement