Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. # Netscape HTTP Cookie File
  2. # https://curl.haxx.se/docs/http-cookies.html
  3. # This file was generated by libcurl! Edit at your own risk.
  4.  
  5. #HttpOnly_www.xxx.com FALSE / TRUE 0 xxxv5 h_r4hXtn-gNAilZwhvHjYdE3Vr4HewhxtGrxja57LbW03-M9MLNqZSeiW7lQ2wRT9lZypNsAiX0gS0Ev1PrvNkGLmwL3B8ZmyOUMLYbTYbSW0y_aPGrIFlEp4skDzh0GJGIGtFHisCmQjEMlu0CJr0UEw2rCT9jbjzg0IyOnFYxNffaMPo229NZWV7HDfCK5M1_y6MPNvW_Kt-h4qTy8YmqGbfBwKxB-bulV78MSXU9ZWz_DVvdu6jXfPiHwCBDMV8FFBLaXm5rqYgNzvbsq8JLe1xkTPn1PNJhyizUa-hlwB6ev8HNwIwBpzs7406l6mL3VgyrDJpay6bHNoMtjh4fLwI7KapFANhFHfn57mg4
  6. #HttpOnly_www.xxx.com FALSE / TRUE 0 ASP.NET_SessionId txakhdi15oeqxyfq53f44dts
  7.  
  8. echo 'HELLO html1 = '.$html1;
  9.  
  10. ini_set('display_errors', 1);
  11. ini_set('display_startup_errors', 1);
  12. error_reporting(E_ALL);
  13. $username = 'xxx';
  14. $password = 'xxx';
  15. // echo 'STARTING';
  16.  
  17.  
  18.  
  19. //login form action url
  20. $url="https://www.xxxx.com/Login";
  21. $postinfo = "username=".$username."&password=".$password;
  22.  
  23. $cookie_file_path = "cookie.txt";
  24.  
  25. $ch = curl_init();
  26. curl_setopt($ch, CURLOPT_HEADER, false);
  27. curl_setopt($ch, CURLOPT_NOBODY, false);
  28. curl_setopt($ch, CURLOPT_URL, $url);
  29. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  30.  
  31. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
  32. //set the cookie the site has for certain features, this is optional
  33. curl_setopt($ch, CURLOPT_COOKIE, "cookiename=0");
  34. curl_setopt($ch, CURLOPT_USERAGENT,
  35. "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7");
  36. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  37. curl_setopt($ch, CURLOPT_REFERER, $_SERVER['REQUEST_URI']);
  38.  
  39. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  40. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  41. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  42. curl_setopt($ch, CURLOPT_MAXREDIRS,5); // return into a variable
  43. // curl_setopt($ch, CURLOPT_UPLOAD, true);
  44. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST" );
  45. curl_setopt($ch, CURLOPT_POST, 1);
  46. curl_setopt($ch, CURLOPT_POSTFIELDS, $postinfo);
  47.  
  48. // set content length
  49. $headers[] = 'Content-length: 0';
  50. $headers[] = 'Transfer-Encoding: chunked';
  51. curl_setopt($ch, CURLOPT_HTTPHEADER , $headers);
  52.  
  53. $html1 = curl_exec($ch);
  54. echo 'HELLO html1 = '.$html1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement