Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('inc/config.php');
- if(empty($_POST['user'])){header('location: index.php?user=false');}
- else if(empty($_POST['password'])){header('location: index.php?password=false');}
- else
- {
- // Vérification des identifiants
- $password = hash('md5',$_POST['password']);
- $req = $bdd->prepare('SELECT * FROM samp_accounts WHERE pLogin = :pseudo AND pPassword = :pass');
- $req->execute(array(
- 'pseudo' => $_POST['user'],
- 'pass' => $password));
- $resultat = $req->fetch();
- if (!$resultat)
- {
- echo '<div class="alert alert-danger">
- <strong>ATTENTION!</strong>
- Attention ce compte n\'existe pas
- </div>
- ';
- }
- else
- {
- $_SESSION['admin'] = $resultat['pAdmin'];
- $_SESSION['mappeur'] = $resultat['pMappeur'];
- $_SESSION['dev'] = $resultat['pDev'];
- $_SESSION['id'] = $resultat['pID'];
- $_SESSION['login'] = $_POST['user'];
- $_SESSION['email'] = $resultat['pEmail'];
- $_SESSION['password'] = $_POST['password'];
- $_SESSION['key'] = $resultat['ts_key'];
- echo 'Connexion en cours merci de patientez...';
- echo '<meta http-equiv="refresh" content="2; URL=profil.php">';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement