Php 为什么我的代码不提交密码,而是提交“密码”;“登录”;

Php 为什么我的代码不提交密码,而是提交“密码”;“登录”;,php,html,sqlite,Php,Html,Sqlite,当使用Post时,我不会从表格中收到密码,但会从按钮中收到消息 数组([Username]=>000001[login\u btn]=>login) 下面是代码 <form action="checklogin.php" method="post"> <div class="wrap"> <!--make a container that will have all our elements and will be the main stucture of

当使用Post时,我不会从表格中收到密码,但会从按钮中收到消息

数组([Username]=>000001[login\u btn]=>login)

下面是代码

<form action="checklogin.php" method="post">
    <div class="wrap"> <!--make a container that will have all our elements and will be the main stucture of you pages-->
        <div class="logo"></div><!--The logo container-->
        <div class="header_text">Room Booking</div><!--The main header of the fomr-->
        <div class="logins_details_container"><!--The top container-->
            <table class="fields_container"> <!--A simple 2x2 table for the form. We choose to use table as for this simple kind of stuff helps us to be everything well stuctured and putting less attributes at the css-->
                <tr>
                    <td><span>Username</span></td>
                    <td><input class="field" id="Username" name="Username" value="" placeholder="" type="text" /></td>
                </tr>
                <tr>
                    <td><span>Password</span></td>
                    <td><input class="field" id="Password" name="Password" value="" placeholder="" type="text" /></td>
                </tr>
            </table>
            <div class="remeber_me_container"><!--A container for the Remember me text and the checkbox-->
                <div class="remember_me">Remember Me?</div>
                <input  id="remeber_me" name="" value="" type="checkbox" />
            </div>
            <div class="login_btn"><!-- The login button-->
                <input name="login_btn" value="Login" type="submit" />
            </div> 
        </div>
<form/><!-- End of the logins_details_container -->

预订分房
用户名
密码
还记得我吗?
尝试更改

<input name="login_btn" value="Login" type="button" />


您的HTML代码看起来正常。但是您没有提供任何PHP代码

我发现(当我得到这个错误时)的一些东西是

  • 您的“Password”变量是否在php脚本中获得
  • 密码的大写是否正确(密码&非密码)

您能否在php脚本的最开始处回显/打印$password变量?在它被检索/分配给变量之后?

我不确定这是否会阻止将密码发送到您的php脚本,但您上面的HTML页面缺少closing-div

       <form action="checklogin.php" method="post">
             <div class="wrap">
                  <form/>

(我已经删除了所有其他匹配行&以上3行仍然存在。)

您需要使用关闭表单。但是你有一个额外的部门还没有关闭


我认为这不会影响PHP,只是建议而已。如果我们也看到您的部分PHP代码,这会有所帮助。

因为您的表单没有“提交”按钮。这不是按钮吗?如果不是,我将如何改变这一点?很简单。将
type=“button”
更改为
type=“submit”
@AmalMurali-Ah-gotcha-cheers:)如果我想让按钮显示登录怎么办?虽然有人告诉我,它的方式是好的吗?我使用打印(美元后);要显示从一个移动到另一个的所有内容,密码与此不符。
       <form action="checklogin.php" method="post">
             <div class="wrap">
                  <form/>