Donc j'ai bien faits toute les démarches le seul bémole c'est quand résultat j'ai une lettre R qui apparaît dans l'input text ! J'ai donc enlever certaine balise pour que sa soit moin le bazard !
index.php
=============================================>
<?php
session_start();
require ('auth.php');
require_once 'cnx.php';
?>
<?php
if(!empty($_POST)){
$identifiant = $_POST'identifiant'];
$passe = md5($_POST'passe']);
$q = array('identifiant'=>$identifiant, 'passe'=>$passe);
$sql = 'SELECT identifiant,passe FROM me_utilisateur WHERE identifiant = :identifiant AND passe = :passe';
$req = $cnx->prepare($sql);
$req->execute($q);
$count = $req->rowCount($sql);
if($count == 1){
//Verifier si l'utilisateur est actif
$sql = 'SELECT identifiant,passe FROM me_utilisateur WHERE identifiant = :identifiant AND passe = :passe AND etat = 1';
$req = $cnx->prepare($sql);
$req->execute($q);
$actif = $req->rowCount($sql);
if($actif == 1){
$_SESSION'Auth'] = array(
'identifiant' => $identifiant,
'passe' => $passe,
);
$_SESSION'user'] = $row;
$_SESSION'identifiant'] = $row;
header('Location:private.php');
}else{
$error_actif = 'Votre compte n\'est pas actif ! Verifier vos mails pour activer votre compte !';
}
}else{
//Si utilisateur inconnu
$error_unknown = 'Utilisateur inexistant !';
}
}
?>
Private.php
===============================
<?php
session_start();
require ('auth.php');
require_once 'cnx.php';²
?>
<?php
// At the top of the page we check to see whether the user is logged in or not
if(empty($_SESSION'user']))
{
// If they are not, we redirect them to the login page.
header("Location: index.php");
// Remember that this die statement is absolutely critical. Without it,
// people can view your members-only content without logging in.
die("Redirecting to login.php");
}
// Everything below this point in the file is secured by the login system
// We can display the user's username to them by reading it from the session array. Remember that because
// a username is user submitted content we must use htmlentities on it before displaying it to the user.
?>
<input id="appendedInputButton" value="<?php echo ($_SESSION'user']'identifiant']); ?>" type="text">