<script language=javascript>
function validate()
{
document.form1.action="validate.php";
document.form1.submit();
}
function delete()
{
document.form1.action="delete.php";
document.form1.submit();
}
</script>
<body>
while($s=mysql_fetch_row($q))
{
echo "<form name=form1 method=post>
<table width=90% bgcolor='#6CDAF5' align=center>
<tr><th align=left> Bug $i: </tr>
<tr><td>Username: <td> <input type=text value='$s[0]' name=username> </td></tr>
<tr><td>User email-id: <td><input type=text value='$s[1]' name=email> </td></tr>
<tr><td>User Contact-no :<td><input type=text value='$s[2]' name=contactno> </td></tr>
<tr><td>Bug: <td><textarea rows=5 cols=40 name=bug>$s[3]</textarea></td></tr>
<tr><td>Bug-Reason: <td><textarea rows=5 cols=40 name=text1>$s[4]</textarea></td></tr>
<tr><td>Bug-Solution:<td><textarea rows=5 cols=40 name=text2>$s[5]</textarea></td></tr>
<tr><td>Updated-date:<td><input type=text value='$s[6]' name=date></td></tr>
<tr><td width=100% align=right colspan=2><input type=submit value='add this bug with main bugs' OnClick='validate()' >
<input type=submit name=delete value='delete this bug' OnClick=delete()></tr>
</table><br></form>";
}
</body>
我创建了两个按钮"add this bug with main bug"
和"delete this bug"
,单击此按钮时,它必须分别重定向到validate.php
和delete.php
。
我在 Javascript 中提到过,但是当我单击这些按钮时,它不会重定向到另一个页面。