提交表单后,$ _GET值即帖子的id消失了。我怎样才能在提交之后把这个事件......以及所有形式的值...
您可以使用hidden fields
通过form submit
发送其他值。像这样:
<form action="myOtherFile.php" method="GET">
<!-- put it anywhere inside the form and give it a desired name and value -->
<input type="hidden" name="postId" value="PutValueHere" />
<!-- and the rest of the form -->
<input type="text" name="address" value="" />
<!-- and so on ... -->
<input type="submit" value="Submit me" />
</form>
在接收PHP文件中,您将获得如下变量:
if(isset($_GET['postId']))
{
echo "ID is: ".$_GET['postId'];
}