Chrome无法识别我的登录表单

时间:2013-12-01 18:46:47

标签: javascript html forms google-chrome passwords

代码:

<?php $thisPage="Logga in";?>
<?php include 'phpincludes\header.php';?>
<?php include 'phpincludes\login_process_data.php';?>

<div id=divLogin class=divCentered>
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method=POST autocomplete=on>
        <fieldset>
            <?php displayAuthStatus(); ?>
            <label class=loginLabels>Användarnamn:</label>
            <br>
            <br>
            <input class=loginInputs name=username></input>
            <br>
            <label class=loginLabels>Lösenord:</label>
            <br>
            <br>
            <input class=loginInputs type=password name=password></input>
            <br>
            <input id=btnLoginSubmit type=submit value="Logga in"></input>
        </fieldset>
    </form>
</div>

<?php include 'phpincludes\footer.php';?>

我已经阅读了其他几个帖子,但它不适用于我(可能重复):

How to make Chrome remember password for an AJAX form?

why doesn't chrome recognize this login form?

Chrome, Safari and Opera do not remember password on simple form

上下文:那么如何让Chrome识别我的表单并保存密码?

编辑:添加生成的html:

<!DOCTYPE html>
<html hc="a0" hcx="0"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="beginner course page">
<meta name="keywords" content="HTML,CSS,JavaScript,PHP,beginner,course">
<meta name="author" content="Petrus K.">
<!-- using jQuery 1.9.1 due to its IE 6+ browser support -->
<!-- read more: http://jquery.com/browser-support/ -->
<!-- using Googles CDN due to faster load times when fetching the jQuery lib -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Logga in</title>
</head>
<body>


<h1 id="header" class="imagify">Filmsamlingssidan</h1>

<div id="outer_navbar">
    <div id="navbar">
        <ul id="navbarul">
            <li class="navbarli"><a class="navbaritem" href="start.php">Start</a></li>
            <li class="navbarli"><a class="navbaritem" href="filmer_js.php">Filmer (JS)</a></li>
            <li class="navbarli"><a class="navbaritem" href="filmer_php.php">Filmer (PHP)</a></li>
            <li class="navbarli"><a class="navbaritem" href="filmtips.php">Filmtips</a></li>
            <li class="navbarli"><a class="navbaritem" id="currentpage" href="login.php">Logga in</a></li>          <li class="navbarli"><a class="navbaritem" href="kontakt.php">Kontakt</a></li>
        </ul>
    </div>
</div>

<h2 id="subheader" class="imagify">Logga in</h2>
<div id="divLogin" class="divCentered">
    <form action="/mycontent/uppg/uppg4/ver1/login.php" method="POST" autocomplete="on">
        <fieldset>
                        <label class="loginLabels">Användarnamn:</label>
            <br>
            <br>
            <input class="loginInputs" name="username">
            <br>
            <label class="loginLabels">Lösenord:</label>
            <br>
            <br>
            <input class="loginInputs" type="password" name="password">
            <br>
            <input id="btnLoginSubmit" type="submit" value="Logga in">
        </fieldset>
    </form>
</div>

<div id="divFooter">
<p id="text_footer">Sidan är skapad av Petrus K.</p>
</div>


<span id="hc_extension_svg_filters" hidden=""><svg xmlns="http://www.w3.org/2000/svg" version="1.1"><defs><filter id="hc_extension_off"><feComponentTransfer><feFuncR type="table" tableValues="0 1"></feFuncR><feFuncG type="table" tableValues="0 1"></feFuncG><feFuncB type="table" tableValues="0 1"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_highcontrast"><feComponentTransfer><feFuncR type="gamma" exponent="3.0"></feFuncR><feFuncG type="gamma" exponent="3.0"></feFuncG><feFuncB type="gamma" exponent="3.0"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_highcontrast_back"><feComponentTransfer><feFuncR type="gamma" exponent="0.33"></feFuncR><feFuncG type="gamma" exponent="0.33"></feFuncG><feFuncB type="gamma" exponent="0.33"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_grayscale"><feColorMatrix type="matrix" values="0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"></feColorMatrix><feComponentTransfer><feFuncR type="gamma" exponent="3"></feFuncR><feFuncG type="gamma" exponent="3"></feFuncG><feFuncB type="gamma" exponent="3"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_grayscale_back"><feComponentTransfer><feFuncR type="gamma" exponent="0.33"></feFuncR><feFuncG type="gamma" exponent="0.33"></feFuncG><feFuncB type="gamma" exponent="0.33"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_invert"><feComponentTransfer><feFuncR type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncR><feFuncG type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncG><feFuncB type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_invert_back"><feComponentTransfer><feFuncR type="table" tableValues="1 0"></feFuncR><feFuncG type="table" tableValues="1 0"></feFuncG><feFuncB type="table" tableValues="1 0"></feFuncB></feComponentTransfer><feComponentTransfer><feFuncR type="gamma" exponent="1.7"></feFuncR><feFuncG type="gamma" exponent="1.7"></feFuncG><feFuncB type="gamma" exponent="1.7"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_invert_grayscale"><feColorMatrix type="matrix" values="0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"></feColorMatrix><feComponentTransfer><feFuncR type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncR><feFuncG type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncG><feFuncB type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncB></feComponentTransfer></filter><filter id="hc_extension_yellow_on_black"><feComponentTransfer><feFuncR type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncR><feFuncG type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncG><feFuncB type="gamma" amplitude="-1" exponent="3" offset="1"></feFuncB></feComponentTransfer><feColorMatrix type="matrix" values="0.3 0.5 0.2 0 0 0.3 0.5 0.2 0 0 0 0 0 0 0 0 0 0 1 0"></feColorMatrix></filter><filter id="hc_extension_yellow_on_black_back"><feComponentTransfer><feFuncR type="table" tableValues="1 0"></feFuncR><feFuncG type="table" tableValues="1 0"></feFuncG><feFuncB type="table" tableValues="1 0"></feFuncB></feComponentTransfer><feComponentTransfer><feFuncR type="gamma" exponent="0.33"></feFuncR><feFuncG type="gamma" exponent="0.33"></feFuncG><feFuncB type="gamma" exponent="0.33"></feFuncB></feComponentTransfer></filter></defs></svg></span></body></html>

3 个答案:

答案 0 :(得分:0)

尝试

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" autocomplete="on">

我相信在方法属性中缺少双引号会使事情变得混乱。

<强>完整

<?php $thisPage="Logga in";?>
<?php include 'phpincludes\header.php';?>
<?php include 'phpincludes\login_process_data.php';?>

<div id="divLogin" class="divCentered">
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" autocomplete="on">
        <fieldset>
            <?php displayAuthStatus(); ?>
            <label class="loginLabels">Användarnamn:</label>
            <br>
            <br>
            <input class="loginInputs" name="username"></input>
            <br>
            <label class="loginLabels">Lösenord:</label>
            <br>
            <br>
            <input class="loginInputs" type="password" name="password"></input>
            <br>
            <input id="btnLoginSubmit" type="submit" value="Logga in"></input>
        </fieldset>
    </form>
</div>

<?php include 'phpincludes\footer.php';?>

答案 1 :(得分:0)

添加最后一段php代码似乎已经成功了.. 这突然之间起了作用:

function signInUser()
{
    $_SESSION["signedin"] = true;
    session_regenerate_id();
    header('Location: admin.php');
}

function signOutUser()
{
    session_destroy();
    header('Location: login.php');
}

答案 2 :(得分:0)

只需将URL与https://

一起使用

Chrome从非安全的http://

禁用