<?php include('../includes/config.php'); if(isset($_POST['login'])) { if(empty($_POST['username']) && empty($_POST['password'])) { echo 'Please fill all fields!'; } else { $salt = '$2a$06$t9/0hs.mlgssodGR7hLQPO'; $username = mysqli_real_escape_string($con, $_POST['username']); $password = crypt($_POST['password'], $salt); $sql = "SELECT * FROM admin WHERE username='$username' AND password='$password'"; $run_query = mysqli_query($con, $sql); $check_user = mysqli_num_rows($run_query); if(!$check_user) { echo 'Bad username or password!'; } else { header('Location: home/index.php'); } } } ?>
You have javascript disabled. You will not be able to edit any code.