harkly Posted February 9, 2010 Share Posted February 9, 2010 Trying to get my logic down before I start to code it - not sure if this should be in this forum I am trying to set up my Login in page and I need to have it check to make sure that the user’s account is ‘active’. I need a little advice on the best way to do this. There are 4 different types of accounts, based on months in the year - - 1,3,6,12 I have a bill table, every time a user is billed it will add a new line to the table – is this a good idea?? Or should it over write?? Bill table -- billID userID bill_code (this is the 1,3,6,12) dateBilled billedAmount user table -- userID status Should I set it up to compare the dateBilled with the bill_code and make a decision as to whether the account status is active or not? I think this might be useful for when the subscription runs out and the user does nothing. Should I have the bill_code and the dateBilled in the user table as well? Maybe something like this? Bill table -- billID userID dateBilled billedAmount user table -- userID bill_code (this is the 1,3,6,12) dateLastBilled status As you can tell my thought process is not very clear on how I should approach this. Any suggestions would be appreciated. Link to comment https://forums.phpfreaks.com/topic/191532-php-logic-for-login-page/ Share on other sites More sharing options...
d_barszczak Posted February 9, 2010 Share Posted February 9, 2010 Hi, Im not sure exactly what you are trying to do but I think I have an idea. Are the months in the year the length of subscription? If they are I would create the bill with a start_date and an expiery_date. I would certainly keep a table of all bills so you have a record. You could then query the database for the expiery date as well as the username and password. If the date is => todays date then deny access. You may need to mark the current subscription to make the query a little easier. Link to comment https://forums.phpfreaks.com/topic/191532-php-logic-for-login-page/#findComment-1009677 Share on other sites More sharing options...
harkly Posted February 10, 2010 Author Share Posted February 10, 2010 Thanks! That helps, I didn't think about adding and experation date! Link to comment https://forums.phpfreaks.com/topic/191532-php-logic-for-login-page/#findComment-1010036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.