Premier commit - Inclusion dans le projet git

This commit is contained in:
Mysaa
2021-06-05 18:05:11 +02:00
commit 3e8d10144f
12 changed files with 352 additions and 0 deletions
+29
View File
@@ -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();
?>