Jump to content

php logic for login page


harkly

Recommended Posts

Trying to get my logic down before I start to code it - not sure if this should be in this forum  :shrug:

 

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.