forked from wenboxiao/trouvetateamvc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPass.php
40 lines (38 loc) · 1.02 KB
/
Pass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php session_start(); ?>
<?php
if (($_POST['tttpseudo'])=="" AND ($_POST['tttpass']=="")) {
include("Connexion2.php");
}
else{
if (isset($_POST['tttpseudo']) AND (isset($_POST['tttpass']))) {
try
{
$bdd = new PDO('mysql:host=localhost;dbname=trouve_ta_team;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$req = $bdd->prepare('SELECT MotDePass FROM utilisateurs WHERE NomUtilisateur = ?');
$req->execute(array($_POST['tttpseudo']));
if($donnees = $req->fetch()){
if ($_POST['tttpass']==$donnees['MotDePass']) {
$_SESSION['tttpseudo']=$_POST['tttpseudo'];
$_SESSION['tttpass']=$_POST['tttpass'];
$req->closeCursor();
header('Location: Profild.php');
}
else{
$req->closeCursor();
include("Connexion5.php");
}
}
else{
$req->closeCursor();
include("Connexion4.php");
}
$req->closeCursor();
}
else {
include("Connexion2.php");}}
?>