首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chrome不认识我的登录表单

Chrome不认识我的登录表单
EN

Stack Overflow用户
提问于 2013-12-01 18:46:46
回答 3查看 2.5K关注 0票数 2

代码:

代码语言:javascript
复制
<?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:

代码语言:javascript
复制
<!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>
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-12-08 22:09:23

添加最后一段php代码似乎已经做到了这一点。这就是突然让它发挥作用的原因:

代码语言:javascript
复制
function signInUser()
{
    $_SESSION["signedin"] = true;
    session_regenerate_id();
    header('Location: admin.php');
}

function signOutUser()
{
    session_destroy();
    header('Location: login.php');
}
票数 0
EN

Stack Overflow用户

发布于 2013-12-01 19:35:37

试着做

代码语言:javascript
复制
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST" autocomplete="on">

我认为在method属性中缺少双引号会使事情变得一团糟。

完全

代码语言:javascript
复制
<?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';?>
票数 0
EN

Stack Overflow用户

发布于 2019-12-04 08:12:26

只需与https://一起使用url即可。

禁用Chrome格式非安全http://

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20315820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档