我們可以用不同的頁面使用$ _POST 2次嗎? 這個例子..
action.php的
<form action="next.php" method="post">
<input name="test" value="test" />
<button type="submit" name="test">submit</button>
</form>
next.php
<?php
$test=$_POST['test'];
?>
<form action="next1.php" method="post">
<input name="test1" value="<?php echo $test; ?>" />
<button type="submit" name="test1">submit</button>
</form>
next1.php
<?php
echo $test2=$_POST['test1']; >> in here i didnt get test1 value . why ?
?>
你想要在next1.php文件中打印兩個文本字段值? – RaMeSh 2015-03-31 08:39:50
**危險**:此代碼[易受XSS影響](https://www.owasp.org/index.php/Cross-site_Scripting_(XSS))。用戶輸入需要在插入HTML文檔之前進行轉義! – Quentin 2015-03-31 08:56:30
@Michael Halomoan Sihoml,是的,你可以在代碼中使用$ _POST兩次。更多細節請參閱我的答案。 – RaMeSh 2015-03-31 09:18:41