<?php

require_once './connection.php';



if (!isset($_POST['username']) == "" || !isset($_POST['password'])) {

    $username = $_POST['username'];
    $password = $_POST['password'];
//    $password = md5($password1);
    $query = 'select * from tbl_login where username="' . $username . '" and password="' . $password . '"';
//    echo 'query '.$query;
    try {
        $result = mysqli_query($con, $query);
        if ($result) {
            if (mysqli_num_rows($result) > 0) {
                session_start();
                $_SESSION['username'] = $username;
                echo "Login Success .....";
                exit();
            } else {
                echo "Username and password not match.";
                exit();
            }
        } else {
            echo "Username and password not match 123.";
            exit();
        }
    } catch (Exception $ex) {
        
    }
}
?>

