hi, im here again as i have searched and keep turning up answers that usually dont have to do with what i want... for instance, if i search for multiple forms in one page or similar variations of wordings, i get people asking about submitting 2 forms, where i just have 2 co-existing forms. one or the other submitted but not both and one dont need to be hidden.
that said, i have a contact page and the navbar that loads in all my pages has a login form if user isnt logged in and only has a small logout form if user is logged in. lets start with the 2 forms in question.
login:
PHP Code:
<?php
...
<form id="login" action="/contact.php" method="post">
<table class="auth">
<tr>
<th colspan="2">
Login:
</th>
</tr>
<tr>
<td class="auth">
Username:
</td>
<td class="auth">
<input type="text" name="username" size="8" maxlength="30" class="auth">
</td>
</tr>
<tr>
<td class="auth">
Password:
</td>
<td class="auth">
<input type="password" name="passwurd" size="8" maxlength="40" class="auth">
</td>
</tr>
<tr>
<td class="auth">
<a href="/authenticate/index.php?action=register" title="Register">Free Registry</a>
</td>
<td class="auth">
<input class="logbutton" type="submit" name="login" value="Login">
</td>
</tr>
</table>
</form>
...
?>
contact form:
PHP Code:
<?php
...
<form id="contact" method="post" action="/contact.php">
<p><strong>your name (username if registered):</strong><br>
<input type="text" name="sender_name" value="" size=30></p>
<p><strong>your email address:</strong><br>
<input type="text" name="sender_email" value="" size=30></p>
<p><strong>message:</strong><br>
<textarea name="message" cols=34 rows=5></textarea></p>
<p><input type="hidden" name="op" value="ds"></p>
<p><input type="submit" name="submit" value="send this form"></p>
</form>
...
?>
the login form appears first in the page source. i tried naming each form with an id, and each form sets its own action to the submit button. if the user is logged in, it will logout the user but for some reason the session doesnt kill per the logout option as you cant log back in without reopening the browser... but that is the least of the problems and i think it is tied to the login and contact separation. solve one issue the rest falls into place.
ok, so here is the deal. the contact form works fine. the login form doesnt work only on the contact page and if you try to login on that page, it actually messes up the session and you have to close the browser and reopen it to create a new session and log in from some other page. the logout works fine from any other page as well, and you can log in and out all day with no problems...
is there a way to form a separation in which form action or what variables are passed or how or ??? that i can use to separate the forms and make the page work?
now that i asked, the answer may come to me. i will post if i figure it out as someone else may be frustrated and looking and getting the wrong answers from other sites...
if you want, i can post the link to the contact form, but only on request as i dont want to be accused of spamming the board.