Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if ($_POST["username"] == "admin" && $_POST["password"] == sha1("password")) {
- $_SESSION["authorized"] = true;
- session_regenrate_id();
- }
- include_once('inc/connection.inc.php');
- if (isset($_POST['submit']))
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "select userName, password from tbl_customers where userName = '$username' ";
- $result =$db -> query ($query);
- $row = $result->fetch_array(MYSQLI_ASSOC);
- if (password_verify($password,$row['password']))
- {
- $_SESSION['logged']= 1;
- $_SESSION['username'] = $row['username'];
- header('location:index.php');
- }
- else
- {
- echo "The username or password entered is incorrect. Please try again.";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement