session_start(); require_once("connectdb.php"); require_once("../util/mainfunc.php"); require_once("../entities/entities.php"); if(isset($_POST['LOGIN'])) { $username = huyit( $_POST["txtUserName"] ); $password = huyit( md5(md5($_POST["txtPassword"])) ); $check = $admin->check_admin_by_username_password($username, $password); if ( count( $check ) > 0 ) { $_SESSION["LOFWI_ss"] = $check->username; $_SESSION["LOFWI_qu"] = $check->typeofmember; echo "You have logged in successfully."; header("location:intro.php"); // Redirect to intro.php page exit(); } else { page('index.php', 'Login fail ...'); } } ?>