Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- try
- {
- $bdd = new PDO('mysql:host=localhost;dbname=launcher', 'root', '');
- }
- catch (Exception $e)
- {
- die('Erreur : ' . $e->getMessage());
- }
- $c ="saltage";
- $req = $bdd->query('SELECT * FROM user');
- $rep = $req->fetch();
- $rep_p = strtoupper(sha1($rep['password'].$c));
- $rep_u = $rep['username'];
- if(isset($_POST['username']) && isset($_POST['password']))
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username == $rep_u && $rep_p == $password)
- {
- echo "ok";
- }
- else
- {
- echo "error";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement