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

WBOY
Libérer: 2016-06-13 12:26:12
original
824 Les gens l'ont consulté

为什么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 />
Copier après la connexion



OK了
------解决思路----------------------
form name="from1" method="post" action="7.php">
form>
------解决思路----------------------
php有3种获取post值得方式 请都试试 
有空能 _post不能解析你的变量 或者是怎么样的
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!