Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
提交POST方法不调用PHP代码_Php - Fatal编程技术网

提交POST方法不调用PHP代码

提交POST方法不调用PHP代码,php,Php,我正在尝试让我的提交帖子方法工作。如果我输入用户名和密码,按钮就不会让我看到应该看到的回声。它根本没有显示任何东西。我还试着在我提交的帖子后加上一个回音,什么都没发生,我也看不出之前出了什么问题。我使用了一些网站,试图让它自己。我希望你们能帮助我 php: html: <form action="" method="post"> <input type="Text" placeholder ="Enter Username" name="uname" required>

我正在尝试让我的提交帖子方法工作。如果我输入用户名和密码,按钮就不会让我看到应该看到的回声。它根本没有显示任何东西。我还试着在我提交的帖子后加上一个回音,什么都没发生,我也看不出之前出了什么问题。我使用了一些网站,试图让它自己。我希望你们能帮助我

php:


html:

<form action="" method="post">
<input type="Text" placeholder ="Enter Username" name="uname" required> <br />
<input type ="Password" placeholder ="Enter Password" name="psw" required> <br />
<button type="submit">Login</button>
</form>



登录

所有这些代码都在一个文档中

您的代码中有一个空操作(
action=”“
) 实际上,您应该为php代码文件分配url

<form action="/your_path/your_php_file.php" method="post">
    <input type="Text" placeholder ="Enter Username" name="uname" required> <br />
    <input type ="Password" placeholder ="Enter Password" name="psw" required> <br />
    <button type="submit">Login</button>
</form>

“提交”按钮中没有名称
<form action="/your_path/your_php_file.php" method="post">
    <input type="Text" placeholder ="Enter Username" name="uname" required> <br />
    <input type ="Password" placeholder ="Enter Password" name="psw" required> <br />
    <button type="submit">Login</button>
</form>
<form  method="post">
    <input type="Text" placeholder ="Enter Username" name="uname" required> <br />
    <input type ="Password" placeholder ="Enter Password" name="psw" required> <br />
    <button type="submit">Login</button>
</form>