Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts

    How do you display the number of times a certain item was clicked?

    Say I have a picture thats a link, or a text link. how would i, in php display the number of times it was clicked. for instance:

    *link* hits:# here

    thx

    -btw i sux at php and have like 5 books on it but nothing really sticks. anyone know video tutorials for it?
    i used a video series for visual basic and became really good.

  • #2
    Senior Coder
    Join Date
    Aug 2005
    Posts
    1,119
    Thanks
    2
    Thanked 1 Time in 1 Post
    you COULD create a script that just has a log (.txt file) for every image, and then write to the file everytime someone clicks, and then take the contents and echo the amount of contents back.

  • #3
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    or you could just go to the snippets section and grab the working example of link counting, requires no installation besides CHMODing the folder the script is in to 0777.

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If it's for a kind of link resporitory script then usually there will be a filed in the database to record the click count or there may be a different stat table giving the link ID and maybe an IP address or date/time.


  •  

    Posting Permissions

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