任何人都可以看到一個問題,會阻止此代碼不''id''文本框發佈到'updateUser.php'頁面?我一直在坐着,盯着它看了30分鐘,不知道怎麼回事,爲了解決問題,我在另一邊迴應,$ newUser和$ username有正確的數據,但$ id從不填充,即使我爲表單中的值放置了一個字符串。傳遞表單數據與發佈問題
<table>
<form method="post" action="updateUser.php">
<tr>
<td></td><td align="right"><input type="text" id="id1" value="<?php echo "$id" ; ? >" ></input></td>
</tr>
<tr>
<td align="right">Enter your current password:</td><td align="right"><input type="text" id="user1"></td>
</tr>
</br>
<tr>
<td align="right">Enter your new username:</td><td align="right"><input type="text" id="user2"></td>
</tr>
<tr>
<td></td><td><input type="submit" value="Change"></input></td>
</form>
</tr>
而且這裏是有關updateUser.php:
$id = $_GET['id1'];
$password = $_GET['user1'];
$newUser = $_GET['user2'];
$username = $_SESSION['username'];
'形式方法= 「郵報」'='$ _GET [...]'.. 。你需要使用'$ _POST' –
也是你的輸入不具有'name'屬性 –
你有一個看起來像'? >'在''元素中,儘管我沒有測試過,但我懷疑PHP不會試圖實現這一點。 ''>'它應該看起來像。 –