Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. <?php /*
  3.  
  4. $user = "";
  5. $password = "";
  6. $url = "mysite/index.php?action=login2";
  7. $cookie="cookie.txt";
  8.  
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_POST, true);
  11. curl_setopt($ch, CURLOPT_HEADER, true);
  12. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  13. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
  14. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  15. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  16. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  17. curl_setopt($ch, CURLOPT_URL, $url);
  18. curl_setopt($ch, CURLOPT_POSTFIELDS, "&user=$user&passwrd=$password&cookielength=-1&submit=Login");
  19. curl_setopt ($ch, CURLOPT_POST, 1);
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  21. $result = curl_exec($ch);
  22.  
  23. if (curl_error($ch)) {
  24. echo curl_error($ch);
  25. }
  26.  
  27.  
  28. echo $result;
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. */ ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement