i have a program that i would like to incorporate a 30 day free trial into. So after 30 days the user will not be able to log in any longer. When the user signs up, i record the signup date in a table with the variable
$trial_date
(ex. he/she signs up on 2002-23-07, so he/she should have access to 2002-22-08)
Then before the program prompts the log in screen, i want to run a check to make sure he/she is still in the 30 day trial period. I first get the current date:
$current_date = date ("Y") . "-" . date("m") . "-" . date("d");
I then call the table and get the $trial_date (signup date)
I then convert both to unix timestamps:
$current_date = strtotime($current_date);
$trial_date = strtotime($trial_date);
Now im a little lost on the comparison part because the comparison should be TRUE if $trial_date is within 30 days of $current_date and FALSE if it is not.
Someone help me out with this please
Thanks