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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.