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

Ich habe ein paar andere Threads gelesen, aber es funktioniert bei mir nicht (mögliche Duplikate):

Wie kann Chrome das Kennwort für ein AJAX-Formular speichern?

Warum erkennt Chrome dieses Anmeldeformular nicht?

Chrome, Safari und Opera merken sich kein Passwort in einfacher Form

Kontext: Wie kann Chrome mein Formular erkennen und das Kennwort speichern?

BEARBEITEN : Generiertes HTML hinzufügen:

<!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>
2
Petrus K. 1 Dez. 2013 im 22:46

3 Antworten

Beste Antwort

Das Hinzufügen des letzten PHP-Codes scheint den Trick getan zu haben. Dies hat es plötzlich zum Funktionieren gebracht:

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

function signOutUser()
{
    session_destroy();
    header('Location: login.php');
}
0
Petrus K. 8 Dez. 2013 im 22:09

Verwenden Sie einfach die URL mit https: //

Chrome deaktiviert Formular nicht sicher http: //

0
Lamri Djamal 4 Dez. 2019 im 08:12

Versuchen Sie es

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

Ich glaube, dass fehlende doppelte Anführungszeichen im Methodenattribut die Dinge durcheinander bringen.

Vollständig

<?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
Alkis Kalogeris 1 Dez. 2013 im 20:48