2

code:

<?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';?>

I've read a couple of other threads but it's not working for me (possible duplicates):

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

context: So how do I make Chrome recognize my form and save the password?

EDIT: adding generated 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>
Community
  • 1
  • 1
Petrus K.
  • 840
  • 7
  • 27
  • 56
  • Why are you missing double quotes on your class, id, method attribute and autocomplete attribute? – Alkis Kalogeris Dec 01 '13 at 19:32
  • Try adding ``type="text"`` to your name input. I've gotten this to work before with one name as "name," and the other as "pass," one with type "text," and the other "password." If this dosen't work, try rewriting your form from scratch. You might have just made a typo. :) – sheng Dec 02 '13 at 01:14
  • Added double quotes, added `type="text"`, still doesn't work. Also made sure `Offer to save passwords I enter on the web` is checked in my Chrome settings. – Petrus K. Dec 02 '13 at 12:48

3 Answers3

0

Try doing

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

I believe missing double quotes in method attribute is messing things up.

Complete

<?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';?>
Alkis Kalogeris
  • 17,044
  • 15
  • 59
  • 113
0

Adding the last piece of php-code seems to have done the trick.. This is what suddenly made it work:

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

function signOutUser()
{
    session_destroy();
    header('Location: login.php');
}
Petrus K.
  • 840
  • 7
  • 27
  • 56
0

Just use url with https://

Chrome disabled form non secure http://

Lamri Djamal
  • 236
  • 1
  • 10