我有一个php变量“echo $ id”。现在我想使用$ _POST方法来发布变量。我只想知道如何为变量执行此操作,因为$ _POST [$ id]不起作用?我希望$ id从表单发布到另一个页面。
下面是我的函数,其中的$ id为:
function id_generator(){
$id = "";
$a = array("A" , "B");
for($i = 0 ; $i < 3 ; $i++){ $r = rand(0 , 25);
$id .= $a[ $r ];
}
return $id;
}
下面的形式:
<form action="QandATable.php" method="post" id="sessionForm">
<p><strong>1: Your Session ID: </strong><?php echo $id; ?></p>
</form>
感谢
可能重复的[我想从一个窗体发布一个php变量](http://stackoverflow.com/questions/8545082/i-want-to-post-a-php-variable-from- a-form) – Quentin 2011-12-17 14:06:55