Premier commit - Inclusion dans le projet git
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
try{
|
||||
$bdd = new PDO('mysql:host=mysql.hostinger.fr;dbname=u808188674_bcom;charset=utf8', 'u808188674_bcom', '*******************');
|
||||
}catch(Exception $e){
|
||||
die ('Erreur : ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$req=$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();
|
||||
?>
|
||||
Reference in New Issue
Block a user