PHP表单操作无济于事

时间:2019-02-23 18:19:43

标签: php html forms

嗨,我正在尝试学习php,并且在一个php文件中包含以下代码:

<form action="/html/action.php" method="post">
<input id="loginUserName" name="username" type="text" placeholder="User Name" style="margin-top:30px;display:grid;margin:auto">
<input id="loginPassword" name="password" type="password" placeholder="Password" style="margin-top:5px;display:grid;margin:auto">
<input id="loginSubmit" type="submit" style="margin-top:5px;display:grid;margin-left:auto;margin-right:auto"></form>

现在在action.php文件中,我有这个

<?php header("Location: http://google.com");?>

当我单击表单操作上的提交时,它什么也没做。

我尝试通过使用

确定它在正确的位置来进行调试
echo $_SERVER['PHP_SELF'];

它仍然告诉我该文件位于/html/action.php。谁能告诉我我做错了什么?

0 个答案:

没有答案