I would like to use my PHP script and Guzzle to login on this website: https://www.test.de/meintest/login/
However, I already tried many solutions and also read this article, I still fail on logging in.. mostly cause the request is build very complicated.. I have used firefox to log the requests the website is doing when I press "Einloggen" (means login). There is a XHR request done before actually logging in. I think this has to do something with the login and parameters..
This is my code so far:
$loginURL = "https://test.de/meintest/login";
$guzzle = new \GuzzleHttp\Client();
$cookieJar = new \GuzzleHttp\Cookie\CookieJar();
$response = $guzzle->request('POST', $loginURL, [
'form_params' => [
'username' => "0000000000",
'password' => "0000000000",
'action' => 'login'
],
'cookies' => $cookieJar,
'debug' => true
]
);
var_dump($response->getBody()->getContents());
var_dump($guzzle->getConfig('cookies'));
There are also some hidden inputs which get filled with the XHR request I think..
Could you guys may help me and tell me where my failure is..?
EDIT
But I also could assume that the reason why it isn't working is the fact that this line var_dump($guzzle->getConfig('cookies'));
always prints bool(false)
instead of the cookies.. Does the cookies get even saved?
Kind regards and Thank You!