Reputation: 11
I was trying to automate login to my emails through my own website. Here is what I have managed till now. I don't want to save my data on my computer because it is a shared one.
<?php
$src=file_get_contents('https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/&scc=1<mpl=default<mplcache=2');
?>
<html>
<body>
<?php echo $src; ?>
<script>
window.onload = function() {
document.getElementsByName('Email').item(0).value='[email protected]';
document.getElementsByName('Passwd').item(0).value='testpassword';
document.getElementsByName('signIn').item(0).click();
void(0);
}
</script>
</body>
</html>
Why does this not work? Any ideas? I'm new to web programming, so any help or suggestions would be appreciated.
Upvotes: 0
Views: 142
Reputation: 40502
It's not possible. Google deny executing of authorisation requests using scripts. There are some ways to prevent this behaviour. I'm sure Google does all necessary things for it.
I can suggest you to use Lastpass browser extension to autologin. In has the master password that you must to remember. It's secure enough even for computers with public access. Until someone get your master password, he doesn't have access to all your saved passwords.
But nothing can protect you from keyboard loggers and network sniffers. So it's totally hopeless.
Upvotes: 1