HTML表单提交给自己

ack*_*hez 7 html php forms submit

有人能告诉我为什么在地球上这不是屈服于自我?

我有以下设置:

<?php
     print_r($_POST);
?>

 <form name="bizLoginForm" method="post" action"" >
    <table id="loginTable">
        <tr><td>Username:</td><td><input type="text" id="loginUsername" /></td></tr>
        <tr><td>Password:</td><td><input type="password" id="loginPassword" /></td></tr>
    </table>
    <input type="Submit" value="Login" />
</form>
Run Code Online (Sandbox Code Playgroud)

每次我点击提交按钮,我都不会在POST数组中看到任何内容.我完全忽略了什么简单的事情?

谢谢!

Ric*_*d M 11

除了action表单元素中的属性中缺少equals这一事实.

您的输入需要名称属性:

<tr>
    <td>Username:</td>
    <td><input id="loginUsername" name="loginUsername" type="text" /></td>
</tr>
Run Code Online (Sandbox Code Playgroud)


sjo*_*obe 9

 <form name="bizLoginForm" method="post" action"" >
Run Code Online (Sandbox Code Playgroud)

应该

 <form name="bizLoginForm" method="post" action="" >
Run Code Online (Sandbox Code Playgroud)

缺少=标志.

您还缺少输入标记中的name属性,因此请进行更改

<input type="text" id="loginUsername" />
Run Code Online (Sandbox Code Playgroud)

<input type="password" id="loginPassword" />
Run Code Online (Sandbox Code Playgroud)

<input type="text" id="loginUsername" name="loginUsername" />
Run Code Online (Sandbox Code Playgroud)

<input type="password" id="loginPassword" name="loginPassword" />
Run Code Online (Sandbox Code Playgroud)