Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sql_hote='localhost';
- $sql_db='db';
- $sql_user='utilisateur_db';
- $sql_password='motdepasse_db';
- if(isset($_POST['user'], $_POST['pwd'], $_POST['uuid'])){
- try {
- $dbc=new PDO('mysql:host='.$sql_hote.';dbname='.$sql_db, $sql_user, $sql_password);
- $username=preg_replace("/[^a-zA-Z0-9]+/", "", $_GET['user']);
- $password=$_GET['password'];
- $selectStmt=$dbc->prepare('SELECT * FROM joueurs WHERE user_pseudo = :pseudo');
- $selectStmt->execute(array(':pseudo' => $username));
- $row=$selectStmt->fetch();
- unset($selectStmt,$dbc,$sql_hote,$sql_db,$sql_user,$sql_password);
- if($row) {
- if($row['user_mdp']==$password) {
- echo TRUE;
- exit();
- }
- else {
- echo FALSE;
- exit();
- }
- }
- else {
- echo FALSE;
- exit();
- }
- }
- catch(Exception $e) {
- echo FALSE;
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement