我能夠創建一個textarea框,它將接受文本並將該文本存儲到$ _POST超級全局文件中,但是一旦提交,我就無法讓文本「回到」框中。 (表格是自我提交的)。如果我運行所提交的數據的簡單的回聲,但是,它顯示正常(如向下面的腳本結束所示。我可以自己提交回textarea盒嗎?
<!DOCTYPE html> <body> <?php require("Connection_to_WS.php");
echo ("<form action='Edit_Thread_Description.php' method='post'>");
IF (ISSET($_POST['revised_thread_descr'])) {
$revised_thread_descr=($_POST['revised_thread_descr']);
ECHO "Edit the Revised_Thread_Description here: <br> <textarea name='revised_thread_descr' rows='5' cols='50' value= $_POST[revised_thread_descr]"; // Fails to return any text on Submit.
?><p></textarea></p><br><?php
}
ELSE {$revised_thread_descr= '[some default]';
ECHO "Edit the Revised_Thread_Description here: <br> <textarea name= 'revised_thread_descr' rows='5' cols='50' value= $revised_thread_descr";
?><p></textarea></p><br><?php
}
ECHO '<br>';
echo $_POST['revised_thread_descr']; // Succeeds in returning POST text from the textarea box upon Submit (but outside of the textarea box).
ECHO '<br>';
echo "Click 'Submit': <input type='Submit' name='submit' value='Submit'/>";
echo '<br>';
mysqli_close($connection);
?>
</body> </html>
在做同樣的事情用「<input type
」輕而易舉,但我「已經沉沒小時後得到<textarea
合作。我,我會的任何援助表示感謝。
textarea的不使用數值來顯示內容 –