26 lines
499 B
PHP
26 lines
499 B
PHP
<?php
|
|
|
|
session_start();
|
|
|
|
include_once 'includes/bdd.php';
|
|
|
|
|
|
$req=$GLOBALS['bdd']->prepare('SELECT * FROM users WHERE pseudo=?');
|
|
$req->execute(array($_POST['pseudo']));
|
|
$reponce=$req->fetch();
|
|
|
|
if($reponce != null){
|
|
if($reponce['mdp']===$_POST['mdp']){
|
|
$_SESSION['session_id'] = $reponce['ID'];
|
|
$_SESSION['session_mdp'] = $reponce['mdp'];
|
|
header('Location:index.php?i=0');
|
|
}else{
|
|
header('Location:login.php?i=2');
|
|
}
|
|
}else{
|
|
header('Location:login.php?i=1');
|
|
}
|
|
|
|
|
|
$req->closeCursor();
|
|
?>
|