If a User Is Not Logged in, the Login Form Is Loaded : header « HTML « PHP
- PHP
- HTML
- header
If a User Is Not Logged in, the Login Form Is Loaded
<?php
session_start();
if (!isset($_SESSION["username"])) {
header("Location: /protected3/login.php?url=" . urlencode($_SERVER["SCRIPT_NAME"]));
}
?>
Related examples in the same category