Link clicking
Results 1 to 5 of 5

Thread: Link clicking

  1. #1
    Senior Member
    Join Date
    Apr 2005
    Posts
    1,310

    Link clicking

    I want to track how often links are clicked, where they're clicking on at my site etc, maybe the user IP the date/time etc.

    I want going to make all links go to a page redirect.php and pass in a a link ID. So redirect.php?ID=3354

    3354 would be a datebase ID for phpbuilder.com. I would then insert timestamp, IP, refer URL etc into a database then send the user to the end URL.

    Sounds okay but i'll end up with thounds of robot entries. How can I eliminate them or how else can I do this?

  2. #2
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,364
    Well, if you don't really need to hold the data yourself, something like Google Analytics might help (you can push events to them and they'll show up in their reporting interface.

    Apart from that, it's possible to detect most bots. There are some libraries out there ... I'll attach one here in a moment or two.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  3. #3
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,364

    is_bot.php

    Here's a method from a Tracker class I wrote.
    Attached Files Attached Files
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  4. #4
    Senior Member
    Join Date
    Apr 2003
    Location
    Flanders Fields
    Posts
    5,793
    CodeIgniter (a php framework) offers an is_robot function. Learning and implementing CodeIgniter is a non-trivial task, but it's my preferred framework these days.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  5. #5
    Junior Member
    Join Date
    Feb 2016
    Posts
    4
    Thanks for this!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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