SHARE
TWEET

Untitled

a guest May 27th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $username = "ss";
  2. $password = "tt";
  3.  
  4. $url = "https://test.com/login";
  5. $postinfo = "login=".$username."&password=".$password;
  6.  
  7. $cookie_file_path = "cookie.txt";
  8.  
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_HEADER, false);
  11. curl_setopt($ch, CURLOPT_NOBODY, false);
  12. curl_setopt($ch, CURLOPT_URL, $url);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  14. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
  15. curl_setopt($ch, CURLOPT_COOKIE, "cookiename=0");
  16. curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
  19. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  20. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
  21. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  22. curl_setopt($ch, CURLOPT_POST, 1);
  23. curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
  24. curl_setopt($ch, CURLOPT_TIMEOUT, 900);
  25. curl_exec($ch);
  26.  
  27. ////////////////////////
  28.  
  29. curl_setopt($ch, CURLOPT_URL, "https://test/admin/edit/7467");
  30. //curl_setopt($ch, CURLOPT_POST, 1);
  31. //curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
  32. //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  33. //curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
  34. //curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
  35. echo $html = curl_exec($ch);
  36. curl_close($ch);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top