Home > php教程 > php手册 > body text

php表单无法获取值,该如何解决

WBOY
Release: 2016-06-06 19:43:13
Original
1200 people have browsed it

php表单无法获取值 pspanclass="top-head"密码:/span labelfor="password"/label inputname="password"type="text"id="password"value="请输入密码" /p pnbsp;/p pnbsp;/p pspanclass="top-head"密码:/span labelfor="password2"/label inputname="password

php表单无法获取值
Copy after login

密 码 :





密 码 :





邮 箱 :





授权码:
















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

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

}
?>


无法打印出密码
------解决思路----------------------
form表单应该包住所有input输入
提前到input开始之前的地方即可
------解决思路----------------------
用post接受的,可是没看到password的表单,代码没贴全??
------解决思路----------------------
改为这样就可以了。
<br />
<form name="form2" method="post" action="login.php"><br />
<p><span class="top-head">密 码 :</span><br />
    <label for="password"></label><br />
  <input name="password" type="text" id="password" value="请输入密码"><br />
  </p><br />
  <p> </p><br />
  <p> </p><br />
<p><span class="top-head">密 码 :</span><br />
                      <label for="password2"></label><br />
                      <input name="password2" type="text" id="password2" value="请再次密码"><br />
                    </p><br />
<p> </p><br />
<p> </p><br />
  <p><span class="top-head">邮 箱 :</span><br />
                    <label for="password3"></label><br />
                    <input name="password3" type="text" id="password3" value="请输入您的邮箱"><br />
                    </p><br />
<p> </p><br />
<p> </p><br />
<p><span class="top-head">授权码:</span><br />
                      <label for="password4"></label><br />
     &nbsp【本文来自鸿网互联 (http://www.68idc.cn)】;                <input name="password4" type="text" id="password4" value="请输入授权码"><br />
                    </p><br />
<p> </p><br />
<p> </p><br />
  <hr><br />
<p><br />
  <script type="text/javascript" src="js/fliplightbox.min.js"></script><br />
      <script type="text/javascript">$('body').flipLightBox()</script><br />
</p><br />
<p> </p><br />
<br />
<input type="submit" name="ann03" id="ann03" value="提 交"><br />
                    <br />
  </form><br />
                   <?php <br />
  	 	if(isset($_POST['ann03']))<br />
   { <br />
      <br />
   $username = $_POST['password'];<br />
   echo "您输入的用户名是:".$username;<br />
  <br />
   }<br />
?><br />
Copy after login

------解决思路----------------------
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template