<?php 

$conn=mysqli_connect('localhost','root','','sant_live_gwop');

if (isset($_POST['submit'])) {
    $username=mysqli_real_escape_string($conn,$_POST['username']);
    $password=mysqli_real_escape_string($conn,$_POST['password']);
    // print_r($username);
    // print_r($password); die();
    $run =mysqli_query($conn,"SELECT * FROM customers where username='$username' && password='$password'");
    $count=mysqli_num_rows($run);
     if ($count==1) {
     echo "<script>alert(' login successfully...')</script>";
    $_SESSION['username'] = $username;
    echo "<script>window.open('../Success.php','_self')</script>";
}
else{
    echo '<script>alert("Failed to login ! Please Try Again !"); location.replace(document.referrer);</script>';


}

}
 ?>