Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

member record keeping php

Options
  • 26-05-2005 9:27pm
    #1
    Closed Accounts Posts: 87 ✭✭


    Hi,

    Does anybody know of a way of including a php class in a php file that will keep record of how many times members that have logged into certain areas of a site or downloaded certain files.
    Thanks


Comments

  • Moderators, Politics Moderators Posts: 39,769 Mod ✭✭✭✭Seth Brundle


    Would it not be simpler to use a database to retain this info?
    Basic Suggestion:
    3 tables:-
    tblUsers
    tblLoggedInTimes
    tblDownloadedFiles


  • Closed Accounts Posts: 87 ✭✭junglequestions


    Hi,
    Suppose it would bit I dont have a clue how to go about setting it all up!!


  • Closed Accounts Posts: 2,028 ✭✭✭oq4v3ht0u76kf2


    Here's the psuedo code for what you want to do... the PHP website and a text editor are all you need now.

    Members logs in
    Look up member ID in tblUsers
    Find corresponding member ID in tblLoggedInTimes and increment colTimes by one for that row
    END

    Upon clicking a download link:
    Check member is logged in
    If not logged in, inform them to log in and END
    If logged in, get member ID
    Add new row in tblDownloadedFiles with FileID equal to the id of the file and MemberID equal to the members ID
    END

    That isn't a perfect system by far, and the second part especially could be worked better but it's enough for you to start with.


Advertisement