Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $nick = $_POST['userName'];
- $pass = $_POST['passWord'];
- // Of course replace all the foo stuff with actual info, it does connect to the database correctly
- $dsn = "mysql:dbname=foo;host=foo";
- try {
- $dbh = new PDO($dsn, "foo", "foo");
- } catch (PDOException $e) {
- echo "Connection failed: ".$e->getMessage();
- }
- if (isset($_POST['submitButton'])) {
- if ($nick == "" && $pass == "") {
- echo "<p style=\"text-align:center;display-style:block;margin-left:auto;margin-right:auto;margin-top:0px;font-size:18pt;\">Username and password not entered</p>";
- } else if ($nick == "") {
- echo "<p style=\"text-align:center;display-style:block;margin-left:auto;margin-right:auto;margin-top:0px;font-size:18pt;\">Username not entered</p>";
- } else if ($pass == "") {
- echo "<p style=\"text-align:center;display-style:block;margin-left:auto;margin-right:auto;margin-top:0px;font-size:18pt;\">Password not entered</p>";
- } else {
- $loginQuery = $dbh->query("SELECT `PASS` FROM `USER` WHERE `NICK` = '".$nick."'");
- $loginQueryArr = $loginQuery->fetchAll();
- $loginQueryArrActual = var_dump($loginQueryArr);
- if (password_verify($pass, $loginQueryArr['PASS'])) {
- } else {
- echo "<p style=\"text-align:center;display-style:block;margin-left:auto;margin-right:auto;margin-top:0px;font-size:18pt;\">Username/password does not match that on file</p>";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment