我正在设计一个登录页面,使用html和php.it包括两个按钮一个用于登录,另一个重定向到注册page.i计划使用php代码验证同一page.here登录数据是我的代码php:在同一个表单和表单提交中使用两个按钮
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<div>
<table style="width: 100%; height: 377px;">
<tr>
<td rowspan="4"><img src="woman.jpg" height="100%" width="100%" alt="woman"/></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right" style="padding:0px;color:white" >username:</td>
<td><input runat="server" name="Text1" type="text" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="right" style="padding:0px;color:white">password</td>
<td><input runat="server" name="Text2" type="text" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
<td ><input name="Submit1" type="submit" value="login" />
<input onclick="document.location.href='regforswa.php'" name="Submit2" type="submit" value="register" /><br/>
<a href="fp.php" style="color:white">forgot password</a></td>
</tr>
</table>
</div>
</form>
,但注册的按钮不工作properly.it不重定向到登记page.i不想把表格外注册按钮我想保持相同的设计并实现所需的功能。
你为什么不使注册按钮类型为type =“按钮” –