...

View Full Version : Google Style Login



FrickenTrevor
09-01-2009, 03:38 AM
When you view source on the google login page, you see this as the form.


<form id="gaia_loginform" action="https://www.google.com/accounts/LoginAuth?continue=http%3A%2F%2Fwww.google.com%2Fwebhp%3Fsourceid%3Dnavclient%26ie%3DUTF-8&amp;hl=en" method="post" onsubmit="return(gaia_onLoginSubmit());">

I was wondering on how you do this instead of the usual
action="login.php" script

seco
09-01-2009, 03:40 AM
do what?

bacterozoid
09-01-2009, 04:19 AM
Google is still using PHP or some other language to process the login - they just added some parameters that their script uses.


https://www.google.com/accounts/LoginAuth?continue=http%3A%2F%2Fwww.google.com%2Fwebhp%3Fsourceid%3Dnavclient%26ie%3DUTF-8&amp;hl=en
Full URL


https://www.google.com/accounts/LoginAuth
This portion actually points to a script like login.php...you just can't tell because the URL is rewritten


?continue=http%3A%2F%2Fwww.google.com%2Fwebhp
This sets $_GET['continue'] (assuming they use PHP) to http://www.google.com/webhp. That's likely where you go after you login.


%3Fsourceid%3Dnavclient
Equivilant to ?sourceid=navclient. This is setting the $_GET['sourceid'] value for the webhp page.


%26ie%3DUTF-8
&ie=UTF-8 (content encoding)


&amp;hl=en
&hl=en (language)

See http://www.blooberry.com/indexdot/html/topics/urlencoding.htm for more info on URL encoding (all those % codes).

Google really isn't doing anything special...they just send some helper values to their login script so it knows how to do a couple things.

Len Whistler
09-01-2009, 06:42 AM
Looks like perl.



------------

Zangeel
09-01-2009, 10:37 AM
Yea basically they're adding parameters to process on the login page. So for example let's say you have in your url


login.php?continue=http%3A%2F%2Fwww.site.com

On the login page you could use $_GET['continue'] to grab that parameter, and when the login is done you could redirect them to http://www.site.com or any other url in that parameter.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum