Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. array(0) {
  2. }
  3.  
  4. Array
  5. (
  6. )
  7.  
  8. <?php
  9. $username = 'USERNAME';
  10. $password = 'PASSWORD';
  11. $loginUrl = 'https://create.kahoot.it/login';
  12.  
  13.  
  14. //init curl
  15. $ch = curl_init();
  16.  
  17. //Set URL
  18. curl_setopt($ch, CURLOPT_URL, $loginUrl);
  19. //HTTPS
  20. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  21. // ENABLE HTTP POST
  22. curl_setopt($ch, CURLOPT_POST, 1);
  23. //try to echo post variables
  24. var_dump($_POST);
  25. print_r($_POST);
  26. //Set the post parameters
  27. curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&pass='.$password);
  28.  
  29. //Handle cookies
  30. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
  31.  
  32. //Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
  33. // to return the results as a string return value
  34. //from curl_exec() instead of the usual true/false.
  35. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  36.  
  37. //login
  38. $store = curl_exec($ch);
  39. //put page details in file
  40. file_put_contents("test.txt",$store);
  41.  
  42. ?>
  43.  
  44. <html>
  45. <head><title>405 Not Allowed</title></head>
  46. <body bgcolor="white">
  47. <center><h1>405 Not Allowed</h1></center>
  48. <hr><center>openresty/1.11.2.2</center>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement