Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $user_username = "haironfire907";
- $user_password = "dicks";
- error_reporting(E_ALL);
- ini_set('display_errors', '1');
- $dsn = "pgsql:host=db.doc.ic.ac.uk;port=5432;dbname=g1027121_u";
- $user = "g1027121_u";
- $password = "sUyzTDIKq4";
- $link = new PDO($dsn,$user,$password);
- $stmt = $link -> prepare ("SELECT username, password FROM users WHERE username = '${user_username}';");
- $stmt -> execute();
- if ($stmt -> rowCount() < 1) {
- echo "You are not in the database.";
- } else {
- $row = $stmt -> fetch();
- if ($row['password'] == $user_password) {
- echo "OK.";
- } else {
- echo "Wrong password!";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement