'password' $LOGIN_INFORMATION = array( 'admin' => 'password', 'user' => '12345' ); // If you want to use password only (no username), set this to true define('USE_USERNAME', true); // Timeout in minutes define('TIMEOUT_MINUTES', 30); // Timeout in seconds define('TIMEOUT_SECONDS', TIMEOUT_MINUTES * 60); // This variable will be used to store the login status $logged_in = false; // Check if user is logging out if (isset($_GET['logout'])) { setcookie("verify", "", time() - 3600); header("Location: " . LOGOUT_URL); exit(); } // Check if user is already logged in if (isset($_COOKIE['verify'])) { if ($_COOKIE['verify'] == md5($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT'])) { $logged_in = true; } } // If user is not logged in, check login form if (!$logged_in) { if (!isset($_POST['username']) && !isset($_POST['password'])) { // Show login form ?> Login
Username:
Password: