I'm creating a Gmail bot for my work which will check Gmail accounts and see if they require phone verification or not, but I'm stuck on a problem - for some reason, it's giving me an error when I try to make the call and return the html page.
<?php
$url="http://accounts.google.com/AccountLoginInfo";
$data = array('Email' => 'gmail_username', 'Passwd-hidden' => 'gmail_pass');
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded
",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
//print($result);
if ($result === FALSE) {
print("error");
}
?>