为啥php获取不到post提交的值

WBOY
發布: 2016-06-13 12:26:12
原創
822 人瀏覽過

为什么php获取不到post提交的值
nbsp;html>



在PHP中获取表单数据


 


   
   
   
   
   
   
   
   
    
   
    
    
    
用户名:
密码:

    
    


      if($_POST["submit"]=="登录")
  {
  echo "您输入的用户名为:".$_POST[user];
  echo "密码为:".$_POST[pwd];
  }
  else
  {
  echo "error";
  }


?>


------解决思路----------------------
from错了哇

应该是form
------解决思路----------------------
<br /><html><br /><head><br /><meta charset="utf-8"><br /><title>在PHP中获取表单数据</title><br /></head><br /><br /><body> <br /><br /><form name="from1" method="post" action="4.php"><br /><table width="405" border="1" cellpadding="1" cellspacing="1"><br />   <tr><br />   <td width="103" height="25" align="right">用户名:</td><br />   <td align="left"><input type="text" name="user" size="20"></td><br />   </tr><br />   <br />   <tr><br />   <td width="103" height="25" align="right">密码:</td><br />   <td align="left"><input type="password" name="pwd" id="pwd" size="20"></td><br />   </tr> <br />   <br />    <tr><br />    <td align="center" colspan="2"><br />    <input type="submit"   name="submit"  id="submit" value="登录"><br />    </td><br />    </tr><br /></table><br /></form><br /><?php<br />      if($_POST["submit"]=="登录")<br />  {<br />  echo "您输入的用户名为:".$_POST[user];<br />  echo "密码为:".$_POST[pwd];<br />  }<br />  else<br />  {<br />  echo "error";<br />  }<br /><br /><br />?><br /></body><br /></html><br />更多<br />0<br />分享到: <br />
登入後複製



OK了
------解决思路----------------------
form name="from1" method="post" action="7.php">
form>
------解决思路----------------------
php有3种获取post值得方式 请都试试 
有空能 _post不能解析你的变量 或者是怎么样的
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!