session_start(); require_once "functions.php"; $user = new loginRegistration(); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $user_name = $_POST['user_name']; $password = $_POST['password']; if (empty($user_name) or empty($password)) { echo "<h4>Every field should be filup </h4>"; } else { $password = md5($password); $login = $user->userLogin($user_name, $password); if ($login) { $cech = $user->checkscope(); if ($cech == true) { $wait = $user->userwait($user_name); header('Location:wait.php '); } else { header('Location:chat.php'); } } else { echo "Invalid username or password"; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">