密码和用户名显示在输入字段中?

hen*_*.io 4 html browser autocomplete

我有一个愚蠢的问题,我无法弄清楚.当我刷新我的登录页面时,密码和用户名出现在输入字段中.这是我的代码:

<?php include_once "includes/scripts.php"; ?>
<?php
session_start();
include_once ("includes/connect.php");
if (isset($_SESSION['logged_in'])) {
    header('location: admin_cms.php');
}else{
    if (isset($_POST['username'], $_POST['password'])){
        $username = $_POST['username'];
        $password = md5($_POST['password']);
        if (empty($username) or empty($password)){
            $error = '<p>NOTE: Fields are blank</p>';   
        }else{
            $query = $pdo->prepare("SELECT * FROM users WHERE user_name = ? AND user_password =?");
            $query->bindValue(1, $username);
            $query->bindValue(2, $password);
            $query->execute();
            $num = $query->rowCount();
            if ($num == 1){
                $_SESSION['logged_in'] = true;
                header('location: admin_cms.php');
                exit();
            }else{
                $error = "<p>NOTE: The username or password is incorrect</p>";  
            }
        }
    }
    ?>
    <div id="login_container">
        <br><img src="images/camelhorst_logo_full.png" style="margin-top:38px;">
        <h1>LOGIN<img src="images/three_column_grid_line.png" alt="line"></h1>
        <form  acton = "admin.php" method="post" autocompleate="off">
            <label>Username:</label>
            <input type="text" name="username" placeholder="Your Username" required>
            <label>Password:</label>
            <input type="password" name="password" placeholder="Your Password" required>
            <input type="submit"  value="Login" name="submit_login">
        </form>
        <?php if (isset($error))
        {echo $error;}?>
      <p id="copyright_admin"> © CAMELHORSE CREATIVE STUDIO 2013 </p>
    </div><!--login_container-->

    <?php } ?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

请有人帮我解决此问题,如果有人发现可能存在安全问题的问题,请纠正我吗?

我打开页面或刷新时的

exu*_*sum 8

在输入结束时 autocomplete="off"

 <input type="password" name="password" placeholder="Your Password" required autocomplete="off">
Run Code Online (Sandbox Code Playgroud)

Place Holder也可以填充它,以便你可以删除它

 <input type="password" name="password" required autocomplete="off">
Run Code Online (Sandbox Code Playgroud)

您也可以将其autocomplete="off"放在表单标签中