0

Hi i am just wandering if anyone knows how to put a trail login to a php mysql driven website.

for example when you find a website usually providing a service, it requires payment to sign up to use. How would you allow users to sign up for say 30days. i am unsure how this would be done and then after 30 days later access is automaticaly decliened.

thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by diafol
0

Your mysql users table could have a membertype field (values = 0, 1 - which refer to trial, member) and a join_date field.

If the join_date is over 30 days ago and the membertype is 0, decline entry on login. If the member pays membership, change the membertype value to 1.

1

Presuming that you have already sorted out the login system itself, then it should be simple to add a check for the trial period. Each user record could have a trial period flag with a second field for the date that the trial period ends. You could go with just the date if you interpret no end date as being registered. On every login, this field is checked and if it is a past date, then the login fails.

0

Presuming that you have already sorted out the login system itself, then it should be simple to add a check for the trial period. Each user record could have a trial period flag with a second field for the date that the trial period ends. You could go with just the date if you interpret no end date as being registered. On every login, this field is checked and if it is a past date, then the login fails.

That's a really succinct solution - like an expiry_date field. Nice one. :icon_biggrin:

I included the join_date as it tends to be an useful source of info (as in this forum), but if you don't need it, Chris' solution would be better.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.