I found a script and modified it, hoping to returrn the contents of a login page. However, it seems that the page won't let me log in.
using var_dump($_POST);
and print_r($_POST);
gives me a blank array:
array(0) {
}
Array
(
)
So I don't know how to do it. The website is https://create.kahoot.it/login
This is the code I am running:
<?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);
?>
--EDIT--
by changing the postman from POST to GET it returns
{"error":"Authentication failed","exception":"Authentication failed","error_description":"Authentication token of type [class no.mobitroll.core.security.shiro.tokens.SessionToken] could not be authenticated by any configured realms. Please ensure that at least one realm can authenticate these tokens.","timestamp":1499789957919,"duration":0,"errorCode":0}
301 Moved Permanently