My index who included my login page . WHen I enter username and password I go to connection page who include choixsheet. And I have a button in choixcsheet to go to modifiersheet.
When I'm on page modifiersheet and I press previous page or previous button I made in my browser I have this error :
! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: usrPassword in C:\wamp\www\testing\connection.php on line 11
Call Stack
# Time Memory Function Location
1 0.0005 148488 {main}( ) ..\connection.php:0
( ! ) SCREAM: Error suppression ignored for
( ! ) Notice: Undefined index: usrUserName in C:\wamp\www\testing\connection.php on line 12
Call Stack
Here is my login page :
<div align = "center">
<form method="get" action ='connection.php' >
<p> Entrer vos informations </p>
<label for="usrUserName">Votre code d'usager </label> <input
id="usrUserName" name="usrUserName" /><br />
<label for="usrPassword">Votre mot de passe </label> <input
id="usrPassword" name="usrPassword"type="password" /><br />
here is my connection page
<?php
$bdd = new PDO('mysql:host=10.82.182.165;dbname=ohmega', 'zabbix', 'ohmega');
session_start();
//inclut la librairie pour valider le mot de passe
include("PasswordHash.php");
//prend le user et le pass entrée
$usrPassword = $_GET['usrPassword'] ;
$usrUserName = $_GET['usrUserName'] ;
?>
</br>
<?php
if (isSet($_GET['usrUserName']) AND isSet ($_GET['usrPassword']))
{
$req = $bdd->prepare('SELECT usrUserName,usrPassword FROM users WHERE usrUserName = :usrUserName ');
$req->execute(array('usrUserName'=> $_GET['usrUserName'])) or die(print_r($requete->errorInfo()));
$resultat = $req->fetch();
//Si pas le bon user
if (!$resultat)
{
$_SESSION['usrUserName'] = $_GET['usrUserName'];
echo 'Vous avez entré un mauvais identifiant !';
?>
</br>
<?php
echo("Essayer de nouveau.");
?>
<form action = 'Index.php' method="get">
<input type="submit" value="retour" />
</form>
<?php
}
//Si bon user
else
{
//Si bon mot de passe on affiche
$validHash = $resultat['usrPassword'];
$result = validate_password($usrPassword, $validHash);
if ($result)
{
?>
<title>Feuille de temps</title>
<body>
<div id=maincontainer>
<?php
$_SESSION['usrUserName'] = $usrUserName;
include 'choixsheet.php'
?>
</div>
<?php
} else {
//Si mauvais mot de passe
?>
</br>
<?php
echo("Vous avez entré un mauvais mot de passe. ");
?>
</br>
<?php
echo("Essayer de nouveau.");
?>
<form action = 'Index.php' method="post">
<input type="submit" value="retour" />
</form>
<?php
}
}
}
<input type="submit" value="submit" onsubmit="return create_hash()">
</div>
</form>
How I keep my password and username save when I navigate between all my page with no error?