login.php

 avatar
unknown
plain_text
4 years ago
600 B
7
Indexable
<?php 
require_once("connect.php");

if (isset($_POST['submit'])){
    $user = $_POST['user'];
    $pass = $_POST['pass'];


    $login_query = "SELECT Email, Password, Firstname from users_tbl where Email = '$user' AND Password = '$pass' ";
   

    $result = mysqli_query($dbc, $login_query);
    
    if(mysqli_num_rows($result)){
        echo "<script>alert('Logged in!')</script>";
        include("dashboard.php");
         $_SESSION['Email'] = $user;
        
    }
    else {
        echo '<script> alert("PASS")</script>';
        include("main.html");
    }

}

?>
Editor is loading...