Page 1 of 1
Two forms, two submit buttons, different actions
Posted: Wed Jan 15, 2003 6:42 pm
by senthil
Hi,
I'm new to php. i created a sign-in and register page. I have two forms, one for new users registration and other for user login. It has two submit buttons. Each calls different page when clicked.
The registration form is working well. But when I click the submit button for login, it is not working.
Thanks
senthil
Posted: Wed Jan 15, 2003 10:21 pm
by fractalvibes
If you could show some code, answers might be forthcoming from the forum, otherwise we don't know what you are doing in the code!
Phil J.
the code
Posted: Wed Jan 15, 2003 11:31 pm
by senthil
Hi,
Here is the code that i wrote.
Thanks
Senthil
<html>
<head>
<title>Sign-In</title>
</head>
<table>
<tr>
<td rowspan=7 width="15%">
</td>
<td width="40%" colspan=2>
<form name="form1" method="post" action="test_register.php">
<table>
<tr>
<td colspan=2 align="center">
Need a username and password?
</td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="rname"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="rpass1"></td>
</tr>
<tr>
<td>Confirm Password</td>
<td><input type="password" name="rpass2"></td>
</tr>
<tr>
<td>Email Address</td>
<td><input type="text" name="email"></td>
</tr>
<tr height=20></tr>
<tr>
<td colspan=2 align="center">
<input type="submit" name="register" value="Register">
</td>
</tr>
</table>
</form>
</td>
<td rowspan=7 width="15%">
</td>
<td width="40%" colspan=2>
<form name="form2" method="post" action="test_login.php">
<table>
<tr>
<td colspan=2 align="center">
Login
</td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="lname"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="lpass"></td>
</tr>
<tr height=20></tr>
<tr>
<td align="right">
<input type="submit" name="login" value="Login">
</td>
<td align="left">
<input type="reset" name="reset" value="Reset">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
Posted: Wed Jan 15, 2003 11:46 pm
by volka
I took the liberty of reformating your code. Works perfectly on my system. Maybe it was the missing <body>-tag, maybe the error is located at your system....
Code: Select all
<html>
<head><title>Sign-In</title></head>
<body>
<table>
<tr>
<td rowspan="7" width="15%"> </td>
<td width="40%" colspan=2>
<form name="form1" method="post" action="test_register.php">
<table>
<tr>
<td colspan="2" align="center">Need a username and password?</td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="rname"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="rpass1"></td>
</tr>
<tr>
<td>Confirm Password</td>
<td><input type="password" name="rpass2"></td>
</tr>
<tr>
<td>Email Address</td>
<td><input type="text" name="email"></td>
</tr>
<tr height="20"><td> </td></tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="register" value="Register"></td>
</tr>
</table>
</form>
</td>
<td rowspan="7" width="15%"> </td>
<td width="40%" colspan="2">
<form name="form2" method="post" action="test_login.php">
<table>
<tr>
<td colspan="2" align="center">Login</td>
</tr>
<tr>
<td>Username</td>
<td><input type="text" name="lname"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="lpass"></td>
</tr>
<tr height="20"><td> </td></tr>
<tr>
<td align="right"><input type="submit" name="login" value="Login"></td>
<td align="left"><input type="reset" name="reset" value="Reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body></html>