Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2009
    Posts
    40
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Google Style Login

    When you view source on the google login page, you see this as the form.
    Code:
    <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

  • #2
    Regular Coder seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts
    do what?

  • #3
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Google is still using PHP or some other language to process the login - they just added some parameters that their script uses.

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

    Code:
    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

    Code:
    ?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.

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

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

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

    See http://www.blooberry.com/indexdot/ht...rlencoding.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.

  • Users who have thanked bacterozoid for this post:

    FrickenTrevor (09-01-2009)

  • #4
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    Looks like perl.



    ------------
    Leonard Whistler

  • #5
    Regular Coder Zangeel's Avatar
    Join Date
    Oct 2007
    Location
    public_html/
    Posts
    638
    Thanks
    17
    Thanked 79 Times in 79 Posts
    Yea basically they're adding parameters to process on the login page. So for example let's say you have in your url

    Code:
    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.
    PHP Code:
    $aString is_string((string)array()) ? true false// true :D 
    [/CENTER]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •