Need programming help based on PHP

Discussion in 'Programming' started by AimyThomas, Sep 24, 2012.

  1. #1
    Hi,

    I am trying to develop a simple PHP application with quite a 2 hour free trial for my application. I need the account to deactivate after 2 hour. Don’t know how to do and I also want multiple IP protection on single user

    Thanks in Advance
     
    AimyThomas, Sep 24, 2012 IP
  2. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #2
    This is how I would do it.

    1. in the database have a status column (0= not activated, 1=active, 2= deactivated ) or similar.
    2. in the database have a column where you not the date and time of activation.

    Then on every page load check the users activation time and if it is older than 2 hours set the status to deactivated

    Upon login you also need to check that status and if it is deactivated you need to show them a custom error message or redirect them to a page where they can read more about your product.

    as for duplicate IP that can be tricky as there are still people on ISP's that change the IP on the fly. So all those users would be kicked out.
     
    plussy, Sep 24, 2012 IP
  3. RTI

    RTI Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You could also set up a cron job to run at specific intervals. This would keep you from having to query the database on every single page load and possibly updating multiple records, which will bog down your server and sacrifice run time.

    I can help you with all of this if you are still in need, just shoot me a PM.


    Thanks,

    Robert
     
    RTI, Oct 6, 2012 IP