简体   繁体   English

使用 php 提交表单时如何在表单中显示输入的数据

[英]how to show entered data in the form when the form is submitted using php

I want to show the email in the email text input using this code but this code is not working when login is failed.我想使用此代码在 email 文本输入中显示 email,但登录失败时此代码不起作用。

value= "if(isset($_POST['submit'])){ ?PHP echo $_POST[''email]?>";}

You need to enclose PHP code in <?php and ?>您需要在<?php?>中附上 PHP 代码

Hence change:因此改变:

   value= "if(isset($_POST['submit'])){ ?PHP echo $_POST[''email];"}

to

   value= "<?php if(isset($_POST['submit'])) { echo $_POST["email"]; } ?>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM