Posted by Krustov on 10/11/51 11:53
<alt.php>
<Mike>
<20 Jul 2006 04:56:01 -0700>
<1153396561.104691.130090@i42g2000cwa.googlegroups.com>
> a) get the current date plus 1 year so I can store this in a db. I've
> looked at mktime() but this just adds 1 to the year. What happens if
> the current date is feb 29th. If its a leap year next year feb the
> 29th won't happen?
$days=28; $endtime = time() + $days * 24 * 3600;
Change the $days to whatever you want .
Save $endtime to the account details in the database .
> b) check that the current date isn't more than that date in the db?
When checking to see if its been x amount of time .
if (time()>$endtime) {its been more than 28 days}
(note: all the above is untested)
--
Encrypted email address
www.emailuser.co.uk/?name=KRUSTOV
Make a shorter url
www.vhit.co.uk
[Back to original message]
|