如何避免密码和电子邮件文本字段中的预填表单值

时间:2017-01-25 07:59:18

标签: php html5 cookies

我的页面中有登录和注册表单。当我在浏览器中保存我的登录凭据(电子邮件和密码)时,下次打开网站时,我的注册表单中的登录凭据以及字段(电子邮件和密码)将自动填写。我想避免仅在注册表中自动填写。

我想它可能是饼干,但我对饼干一无所知。有人可以帮我吗?

请找到我的注册和登录表格代码

                                                                                                                                                                                                                                                               电子邮件应采用格式                                                                                                                                                                                                                                                                                                                                                                                                 清新                                     有经验的                                                                   选择您的状态                                                                                                   寄存器                                        
 <div id="log"><!--............Login Form.............................-->
                <form action="" method="POST" autocomplete="off" id="form1">
                  <input type="text" name="email_id" id="email_id3" placeholder="Email or Phone number" ">
                  <input type="Password" name="passwrd" id="passwrd3" placeholder="Password" >                    
                   </br>
                  <button type="submit" name="sub1" id="login" class="">login</button>
                  <div id="wrng01"></div><div id="wrng"></div>
                </form>
     </div>           

1 个答案:

答案 0 :(得分:0)

我不确定,因为此时您还没有添加相应的代码,但是与登录和注册表单相同的名称和ID是什么?

是这种情况吗?

<强>注册

<input type="email" name="email">

<强>登录

<input type="email" name="email">

如果是这样,试试这个:

<强>注册

<input type="email" name="registration-email">

<强>登录

<input type="email" name="login-email">

只需确保更新您的PHP代码以匹配帖子变量。

或者直接禁用自动填充功能

autocomplete="off"添加到相应的输入

像这样:<input type="email" name="email" autocomplete="off">