This topic is locked

Calculate date

8/10/2008 9:36:52 AM
PHPRunner General questions
J
jetacera author

I'm using PHPR 4.2 build 358 with a mySQL db.
I have 2 DATETIME fields - regdate (for the registration date) and expdate (for the expiration date). When a person registers I want to calculate the expiration date to be one year after the regdate.
Then, if they attempt to login after the expdate, they cannot login unless they renew. If they renew, the regdate is reset as is the expdate. I'd like them to be able to renew before the expdate and have it add a year to the expdate.
I'm guessing I need to use some type of event for this. Help would be appreciated.
Thanks,
Janet

T
thesofa 8/10/2008

Hi

You need to split the date value into the Year, Month and Day parts, so search here for date functions.

this post may help with date functions.
There is a long post about dates here too
Good luck

J
Jane 8/11/2008

Janet,
I recommend you to have a look at the Members template:

http://www.asprunner.com/forums/index.php?showtopic=7982

J
jetacera author 8/28/2008

I purchased the members template and after some testing with it I posted some questions in the Members Template forum, but have not received any replies. Should I now post my questions in this forum instead?