you could set a cookie that expires in 1 day the first time they access the page. Then just check for this cookie.
If you don't like this then you could do this:
ASSUMPTION
the user has logged in and has a numeric userid
/ASSUMTPION
CREATE TABLE IF NOT EXISTS restricted (
ID BIGINT NOT NULL auto_increment,
UserID BIGINT NOT NULL,
Page VARCHAR(255) NOT NULL,
Accessed TIMESTAMP NOT NULL
)
function check_accessed($userid) {
global = $PHP_SELF;
$epoch_ts = strtotime("-1 day");
$epoch = date("YmdGis");
$sql = "SELECT * \n";
$sql .= "FROM restricted \n";
$sql .= "WHERE UserID=$userid \n";
$sql .= " AND Accessed > '$epoch' \n";
$sql .= " AND Page = '" . $PHP_SELF . "'";
$check = @mysql_query($sql);
//user already accessed this page in the last 24 hours
if(@mysql_num_rows($check) > 0) {return 0;}
//user has not accessed this page in the last 24 hours
return 1;
} //end check accessed
function record_access($userid) {
global $PHP_SELF;
$sql = "INSERT INTO restricted (UserID,Page) VALUES ($userid,$PHP_SELF)";
if(@mysql_query($sql)) {return 1;}
return 0;
}