Page 1 of 1

php WITH Gmail

Posted: Wed Feb 02, 2011 11:17 pm
by siddesh.savant
Hello Friends,
I will have username and password of gmail
I want to develop an application in which i have an login in my site.When i do login in my site . I must get automatically login into gmail.There must be a link when the user clicks on the link he must be automatically get login into the site.
I will demostrate it with am example

Username:XXXXX
Password:XXXXX

Click here to go to gmail


It will be something like above on my Website.When user enters the Username and password And gets login and if he clicks on the link.He must be able to see his gmail account.I meam to say he must be login to gmail..

Re: php WITH Gmail

Posted: Thu Feb 03, 2011 1:52 am
by tutigan
Please note, the following is not my code, but was supplied by a developer co-worker, so I cannot help you if it does not work... although I am sure we can all have a look at try to help if it does not!

Code: Select all

<form id="gaia_loginform" action="https://www.google.com/accounts/ServiceLoginAuth?service=mail" method="post" onsubmit="return(gaia_onLoginSubmit());">
<div id="gaia_loginbox">

<table>
<tr><td valign="top" style="text-align:center" nowrap="nowrap" bgcolor="#e8eefa">
<input type="hidden" name="ltmpl" value="default">
<input type="hidden" name="ltmplcache" value="2">
<div class="loginBox">
<table>
<tr><td colspan="2" align="center">

<font size="-1">
Sign in to
Gmail
with your
</font>
<table>
<tr><td valign="top">
<img src="google_transparent.gif" alt="Google"></img></td>
<td valign="middle">
<font size="+0"><b>Account</b></font></td>
</tr>

</table>
<script type="text/javascript"><!--
function onPreCreateAccount() { return true; } function onPreLogin() { if (window["onlogin"] != null) { return onlogin(); } else { return true;} } --></script>
<tr>
<td nowrap="nowrap"><div align="right"><span class="gaia le lbl">
Username:
</span></div></td>
<td> <input type="hidden" name="continue" id="continue" value="http://mail.google.com/mail/ui=html&zy=l" />
<input type="hidden" name="service" id="service" value="mail" />
<input type="hidden" name="rm" id="rm" value="false" />
<input type="hidden" name="ltmpl" id="ltmpl" value="default" />

<input type="hidden" name="ltmpl" id="ltmpl" value="default" />
<input type="hidden" name="scc" id="scc" value="1" />
<input type="text" name="Email" id="Email" size="18" value="" class='gaia le val' /></td></tr>
<tr>
<td></td>
<td align="right">
</td>
</tr>
<tr>
<td align="right">

<span class="gaia le lbl">
Password:
</span>
</td>
<td>
<input type="password"
name="Passwd" id="Passwd"
size="18" class="gaia le val" /></td></tr>
<tr>
<td align="right" valign="top">
<input type="checkbox" name="PersistentCookie" id="PersistentCookie"
value="yes" />

<input type="hidden" name='rmShown' value="1" />
</td>
<td>
<label for="PersistentCookie" class="gaia le rem">
Remember me on this computer.
</label>
</td>
<tr><center><td><input type="submit" class="gaia le button" name="signIn" value="Sign in" /></td>
</tr></table></div></td></tr></table></div>
<input type="hidden" name="asts" id="asts" value="">
</form>

<form id="gaia_universallogin"
action="https://www.google.com/accounts/ServiceLoginAuth?service=mail" method="post"
onsubmit="return(gaia_onLoginSubmit());">
<input type="hidden" name="continue" id="continue" value="http://mail.google.com/mail/?ui=html&zy=l" />
<input type="hidden" name="service" id="service" value="mail" />
<input type="hidden" name="rm" id="rm" value="false" />
<input type="hidden" name="ltmpl" id="ltmpl" value="default" />
<input type="hidden" name="ltmpl" id="ltmpl" value="default" />
<input type="hidden" name="scc" id="scc" value="1" />
<input type="hidden" name="ltmpl" id="ltmpl" value="default" />
<input type="hidden" name="ltmplcache" id="ltmplcache" value="2" />

</form></div>