如果表单包含类型为password的字段,那么Firefox(v39.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的这种行为呢?
我已经测试了您的代码,我认为您的action
是错误的,应该只是action="?"
好的,问题不是action属性。我用一个新的配置文件启动了Firefox,现在脚本运行良好。但我不确定是旧配置文件中的哪个设置导致了这个问题。