PHP将文本发送到<input type ="text">

dad*_*ona 0 php xhtml

如何将表单中的信息发送到PHP代码块然后再返回文本区域?我找不到这个答案.

ste*_*ase 5

要打印出您在下一个请求的文本字段中输入的文本,请假设您呈现相同的页面(即myform.php):

<?php
  $fieldValue = htmlentities($_POST['myfield']);
?>

<form action="myform.php" method="post">
  <label for="myfield">Your textfield:</label>
  <input type="text" name="myfield" id="myfield" value="<?php echo $fieldValue; ?>" />
</form>
Run Code Online (Sandbox Code Playgroud)