Go to
www.php.net and look up the command gmdate() and mktime()
I recently had the same problem trying to update logged in members at my forum and expiring them after a certain time.
From these two commands and a datetime column in your database you can achieve what is needed.
It would look similiar to;
Code:
$next_month = mktime (gmdate("H"), gmdate("i"), gmdate("s"), gmdate("m")+1, gmdate("d"), gmdate("Y"));
$later = gmdate("Y-m-d H:i:s", $next_month);
This command will get a date from today to next month.
The next step would be to INSERT the $next_month value into the datetime column in your database.
Finally, when someone returns to your site you need to extract the datetime you inserted into the database, and compare it against todays date.
Code:
$today = gmdate("Y-m-d H:i:s");
$query = "SELECT datetime FROM database WHERE youknowthispart";
$result = mysql_query($query,$database_link);
$next_month = mysql_result($result,0);
// Compare
if ($today > $next_month) {
echo "Today is greater than next month";
} else {
echo "Today is not greater than next month";
}
I hope this gives you some tips on how to do this.