Merging two login forms

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
legionarius
Forum Newbie
Posts: 3
Joined: Sat Mar 27, 2010 2:49 pm

Merging two login forms

Post 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>
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: Merging two login forms

Post by jraede »

What's the difference in functionality between the two forms?
legionarius
Forum Newbie
Posts: 3
Joined: Sat Mar 27, 2010 2:49 pm

Re: Merging two login forms

Post 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.
bibumathew
Forum Newbie
Posts: 8
Joined: Tue Aug 03, 2010 5:36 pm

Re: Merging two login forms

Post 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
Post Reply