Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- array(0) {
- }
- Array
- (
- )
- <?php
- $username = 'USERNAME';
- $password = 'PASSWORD';
- $loginUrl = 'https://create.kahoot.it/login';
- //init curl
- $ch = curl_init();
- //Set URL
- curl_setopt($ch, CURLOPT_URL, $loginUrl);
- //HTTPS
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- // ENABLE HTTP POST
- curl_setopt($ch, CURLOPT_POST, 1);
- //try to echo post variables
- var_dump($_POST);
- print_r($_POST);
- //Set the post parameters
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&pass='.$password);
- //Handle cookies
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- //Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
- // to return the results as a string return value
- //from curl_exec() instead of the usual true/false.
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- //login
- $store = curl_exec($ch);
- //put page details in file
- file_put_contents("test.txt",$store);
- ?>
- <html>
- <head><title>405 Not Allowed</title></head>
- <body bgcolor="white">
- <center><h1>405 Not Allowed</h1></center>
- <hr><center>openresty/1.11.2.2</center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement