首页 > 解决方案 > 密码属性填充不需要的用户名和密码

问题描述

我正在尝试在 php 中创建一个登录页面。

我收到了表单并且登录验证工作正常,但是当我转到index.php我的登录页面时,登录凭据会自动填充不需要的凭据,如下所示。

在此处输入图像描述

而我的登录页面应该是这样的..

在此处输入图像描述

我的表格如下:

<form action="check_login.php" method="post">
    <label id="uname">User Name: </label><input type="text" placeholder="Enter Username" name="uname" required="required"> <br>
    <label id="psw">Password: </label><input type="password" placeholder="Enter Password" name="psw" required="required"> <br> <br>
    <button type="submit" name="login">Login </button>
</form>

当我使用它时type=text,它工作正常..

我也试过autocomplete="off"了,还是不行。。。

我究竟做错了什么?我是新手...请帮助我...

标签: phpforms

解决方案


改变

<input type="text" placeholder="Enter Username" name="uname" required="required">

<input type="text" placeholder="Enter Username" name="uname" required="required" autocomplete="off" />

自动填写表格是浏览器功能


推荐阅读