Need Help to make this logic in php?

Discussion in 'PHP' started by kcm4web, Oct 5, 2010.

  1. #1
    hi Gurus

    i am developing a learning application in php. in that system user can buy 1to 6 learning package for 1 year. so after 1 year he/she will be stoped. from the date of buying the package to 1 year of the package. how will i do this? can any body help me.???
     
    kcm4web, Oct 5, 2010 IP
  2. ramsarvan

    ramsarvan Greenhorn

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    hi,
    If all the learning packages are given as data to read from your site or it can be downloaded ?

    If you allow your user to read these documents from your site. Then store there date of purchace in one field and their
    expire period in another field.
    Now, when user comes to the documents links page .First check whether the user have purchached it or not. Second
    check for expire date(check whether current date is greater than expire date).If so, show the documents, link. If not show a text that your validity expires.
     
    ramsarvan, Oct 5, 2010 IP
  3. anupviews

    anupviews Member

    Messages:
    795
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #3
    There is so simple way to do that..
    First set the time of expiry to 1 year whenever user purchases a package. Obviously you'll store this in database.
    And in the page of viewing that package or whatever, set the script to fetch out the expiry date. If the expiry date hasn't reached yet show the page that he can access else notify him that the package expired.

    You can also show a reverse counter showing the days left for the expiry of the package.
     
    anupviews, Oct 5, 2010 IP
  4. ilyakar

    ilyakar Peon

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i would do it by adding the user that bought a package to the db with name date etc. everytime he would log in, the script would check if the 1 year has passed or not, then allow or disallow him the privilage of viewing the content.
     
    ilyakar, Oct 7, 2010 IP