Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Thanked 0 Times in 0 Posts

    help with auto expiring login for protected content

    I want to create a login page using php that uses mysql as the database.
    I have some prebuilt html pages that I want the registered users to only have access to.
    I would also like the logins to expire 7 days from the first time they are logged in and a way to delete the expired logins from the database and a simple way to add new ones from a text file.

    I saw the example in this thread http://www.codingforums.com/showthread.php?t=1863
    That uses cookies once they have been authorized for a login with php and mysql

    All suggestions are welcome. I am relatively new to php and mysql but I learn fast

    I am not looking for someone to build this for me (well if you want to, thank you very much); just maybe some links or some code examples or ideas on how to go about this.

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Right Here
    Thanked 0 Times in 0 Posts
    Research sessions and cookies. IF you want a login to "auto login" people for a max of 7 days then you need to set a cookie that expires in 7 days. But I think your trying to do temporary logins? Like if I was to buy a login to look at porn for 7 days, it would only be active from this point to this point kinda thing? Well then you can just create a user/pw that expires this day. Then when they login you can just bump the current time to the expired time. IF its expired, deny access and delete there account OR just set the account to inactive. If it hasn't expired, then allow access... Lots of ways you can go, just depends on what exactly your trying to achieve.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts