I’ve got the following login script..
<?php
$name = $_POST["name"];
$password = $_POST["password"];
$query = "SELECT * FROM users WHERE username = '$name'
AND password = '$password'";
$q=mysql_query($query) or die(mysql_error());
$result = mysql_query($query);
if (mysql_fetch_row($result)) {
/* access granted */
session_start();
header("Cache-control: private");
$_SESSION["access"] = "granted";
header("Location: ./menu.php");
} else
/* access denied – redirect back to login */
header("Location: ./login.html");
?>
mysql_close();
?>
But what would I now need to “menu” to redirect users who are not logged in to the login page? to prevent direct access?
Thanks.
in menu.php?