Firefox / PHP:无法发送密码字段

时间:2016-01-08 15:51:55

标签: php html firefox passwords

如果表单包含密码类型的字段,Firefox(v 39.0)似乎无法通过http发送表单。 提交以下表单后,Firefox会清除页面并停止执行页面。 Firebug显示状态代码200 对于这篇文章,没有错误或警告。在Chrome中,脚本按预期工作。

<!DOCTYPE html>
<html>
<head>
    <title>Password Test</title>
</head>
<body>
    <?php 
    echo '<pre>Post-Data: '; print_r($_POST); echo '</pre>';

    if (isset($_POST['password'])) { 
        echo '<div>Password is: ' . $_POST['password'] . '</div>'; 
    }
    ?>

    <form action="./" method="post">
    Password: <input name="password" type="password" placeholder="Password">
    <button type="submit">Submit</button>
    </form>
</body>
</html>

我猜它有一些安全限制。而且我知道我应该使用https作为密码表单,但这是我老板的决定。 那么,我该如何改变这种Firefox行为?

2 个答案:

答案 0 :(得分:0)

我已经测试了您的代码,我认为您的action错了,应该只是action="?"

答案 1 :(得分:0)

好的,问题不是动作属性。我使用新配置文件启动了Firefox,现在脚本运行正常。但我不确定旧配置文件中的哪个设置会导致此问题。