provided you have php4 or higher, you can change the following:
if (!$auth){
header('WWW-Authenticate: Basic realm="Computerzone HQ");
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
} else {
$_SESSION["auth"]=$auth; //set cookie on user's machine here
echo '<P>You are authorized!</P>';
}
now put this line at the top of each protected page (or above any protected info).
if ($_SESSION["auth"]!="true") {
echo "gettouttahea";
exit;
}
this will work in php 3.x, but you'd have to change the session array. This code assumes that the user has a common browser and that cookies are enabled. Almost all computers on the net meet these criteria, and cookie sessions are the norm now.
also change mysql_numrows to mysql_num_rows() ... (doh!)
hope this helps