要打印出您在下一个请求的文本字段中输入的文本,请假设您呈现相同的页面(即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)