Home > Backend Development > PHP Tutorial > php表单无法获取值

php表单无法获取值

WBOY
Release: 2016-06-23 13:26:05
Original
945 people have browsed it

Copy after login

密 码 :





密 码 :





邮 箱 :





授权码:
















if(isset($_POST['ann03']))
{

$username = $_POST['password'];
echo "您输入的用户名是:".$username;

}
?>


无法打印出密码


回复讨论(解决方案)

form表单应该包住所有input输入

提前到input开始之前的地方即可

用post接受的,可是没看到password的表单,代码没贴全??

改为这样就可以了。

<form name="form2" method="post" action="login.php"><p><span class="top-head">密 码 :</span>    <label for="password"></label>  <input name="password" type="text" id="password" value="请输入密码">  </p>  <p> </p>  <p> </p><p><span class="top-head">密 码 :</span>                      <label for="password2"></label>                      <input name="password2" type="text" id="password2" value="请再次密码">                    </p><p> </p><p> </p>  <p><span class="top-head">邮 箱 :</span>                    <label for="password3"></label>                    <input name="password3" type="text" id="password3" value="请输入您的邮箱">                    </p><p> </p><p> </p><p><span class="top-head">授权码:</span>                      <label for="password4"></label>                      <input name="password4" type="text" id="password4" value="请输入授权码">                    </p><p> </p><p> </p>  <hr><p>  <script type="text/javascript" src="js/fliplightbox.min.js"></script>      <script type="text/javascript">$('body').flipLightBox()</script></p><p> </p><input type="submit" name="ann03" id="ann03" value="提 交">                      </form>                   <?php   	 	if(isset($_POST['ann03']))   {          $username = $_POST['password'];   echo "您输入的用户名是:".$username;     }?>
Copy after login

form都没有 算啥表单啊

form都没有 算啥表单啊

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template