我有一個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