为什么php获取不到post提交的值

WBOY
Libérer: 2016-06-23 13:24:11
original
1069 Les gens l'ont consulté

nbsp;html>



在PHP中获取表单数据


 


   
   
   
   
   
   
   
   
    
   
    
    
    
用户名:
密码:

    
    


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


?>


回复讨论(解决方案)

from错了哇

应该是form

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



OK了


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!