php+mysql同一页面的参数传递

来源:百度知道 编辑:UC知道 时间:2024/06/23 23:14:43
我在index.php中获得了一个id转到MemberDetail.php?id=3(此处的3时index.php页面传过来的保存<?php $no = $_GET['id'];?> )页面下,在MemberDetail.php?id=3页面下其中的部分代码
<form id="form1" name="form1" method="post" action="MemberDetail.php?action=write" onsubmit="return checkform();" >
<input type="submit" name="Submit" value="提 交" class="button"/>   
<input type="reset" name="Submit2" value="重 置" class="button" /> </td>
</tr>
</table>
</form>
我想的是如果点击“提交”按钮之后,还是在这个页面下,但是$id就改变了,我希望它不管怎么“提交”这个$id是一直被传递的,该怎么解决?是不是<form id="form1" name="form1" method="post" action="MemberDetail.php?id="$no" action=write" onsubmit="return checkform();" >这样,在action=""里再添加上id=??,不过我试了一下没法实现,高手讲解一下,先谢了

把它改成这样:
<?php $no = $_GET['id']; ?>

<form id="form1" name="form1" method="post" action="MemberDetail.php?id=<?php echo $no;?>&action=write" onsubmit="return checkform();" >
<input type="submit" name="Submit" value="提 交" class="button"/>
<input type="reset" name="Submit2" value="重 置" class="button" /> </td>
</tr>
</table>
</form>

传递多个参数时用&链接,你可以改成这样:
<form id="form1" name="form1" method="post" action="MemberDetail.php?action=write&id=".$_GET["id"].&" onsubmit="return checkform();" >
<input type="submit" name="Submit" value="提 交" class="button"/>
<input type="reset" name="Submit2" value="