View Full Version : Google Style Login

09-01-2009, 04: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

09-01-2009, 04:40 AM
do what?

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

Full URL

This portion actually points to a script like login.php...you just can't tell because the URL is rewritten

This sets $_GET['continue'] (assuming they use PHP) to http://www.google.com/webhp. That's likely where you go after you login.

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

&ie=UTF-8 (content encoding)

&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, 07:42 AM
Looks like perl.


09-01-2009, 11: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


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.