Page 1 of 1

Merging two login forms

Posted: Tue Aug 03, 2010 4:07 pm
by legionarius
I'll try to keep this simple, I need to make so that when someone logs in using the PRIMARY FORM they are also automatically logged into a SUB FORM using the same username and pass that they entered in the primary form. I hope this makes sense:

PRIMARY FORM

<form action="http://primary...link.com/login.php" method="post" onSubmit="return disablePage();" class="formLayer"><fieldset><legend>Login</legend><br><label>Your Email Address:</label><input type="text" name="email" value="" size="50"><br><label>Password:</label><input type="password" name="password" value="" size="25"><br><br><label></label><input type="submit" name="submitBtn" value="Login" class="btn" onmouseover="this.className='btnhov'" onmouseout="this.className='btn'"> <input type="reset" name="resetBtn" value="Reset" class="btn" onmouseover="this.className='btnhov'" onmouseout="this.className='btn'"><br><br><input type="hidden" name="url" value="/"></fieldset></form>

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

SUB FORM

<form action="http://site2...link.com/login.php" method="post">
<input type="hidden" name="action" value="login" />
<table class="no-backgrounds vtop tbullet" cellpadding="0" cellspacing="0">
<tr>
<th style="width:100px;"><label>Email</label></th>
<td><div class="holder"><div class="fixedtooltip"><p>Please enter your email address.<br />This field is required.</p></div></div>
<input type="text" value="" name="email" /></td>
</tr>
<tr>
<th style="width:100px;"><label>Password</label></th>
<td><div class="holder"><div class="fixedtooltip"><p>Please enter your login password.<br />This field is required.</p></div></div>
<input type="password" name="password" value="" /></td>
</tr>
<tr>
<th class="nobullet">&nbsp;</th>
<td><input class="fleft" type="image" src="/img/buttons/login.png" /></td>
</tr>
</table>
</form>

Re: Merging two login forms

Posted: Tue Aug 03, 2010 6:31 pm
by jraede
What's the difference in functionality between the two forms?

Re: Merging two login forms

Posted: Tue Aug 03, 2010 6:40 pm
by legionarius
I have two separate members areas, and I would like it so that they only have to login one time... i.e. it logs them into both places.

Re: Merging two login forms

Posted: Tue Aug 03, 2010 7:01 pm
by bibumathew
The easier way to achieve is setting a session variable set to true if the user successfully logged in primary form, and check for session variable before showing the sub form, if session variable is true then do not show the sub form