SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have many external links that my user click to leave my site. I want to know which links they are...

    And I can't use redirect programs to track them.

    Is there a solution to this?

    Thanks,

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    heres a solution I just thought up that isn't very good.

    Create a MySQL database
    Insert all the URLS into the database with an ID and Count
    Create a php page that gets the click and adds it to the database

    The URL would looking like this:

    http://www.domain.com/click.php?url=...www.mysite.com

    Once clicked, click.php adds one to the database.

    -Peter

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply.

    However, as I mentioned before, I couldn't use any internal programs to track the outgoing clicks.

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I doubt there is one since you have no control over the link, so you can't use any script/program.

    The one that left is the server log, but clicking a link is a client action, which isn't in the control of the server.

    However, there might be advanced technology I'm not aware of that could solve your problem.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I reckon you can write a script to do this. It would require that your links call a script on the server pasing a get parameter which is the link url.
    You then log the request url in a flat file for batch loading into a database later.

    So your html would be:
    <a href="link.php?link=http://www.dilbert.com">dilbert</a>

    And link.php
    PHP Code:
    <? // link.php
    // if this page gets called by accident redirect to 
    if (!$link) {
       
    $link 'http://www.mysite.com/index.html';
    }
    // format a string with the data you want to log
    $data time() . ' ' $HTTP_REFERER ' ' $link '\n';
    // open log file for appending
    $file fopen('link.log''a') ;
    // write $data to file
    fwrite($file$data);
    fclose($file);
    // now redirect the user to the requested url
    header ("Location: $link");
    ?>
    hehe - I just realised you said you can't run a server script to do this. That's a bit odd then, posting to the server side scriptinf forum saying I want to do this but I can't run a server side script to do it :
    Last edited by freakysid; Apr 12, 2001 at 14:35.

  6. #6
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all your input. However, I couldn't use any scripts...

    To be more specific, a program that redirects a URL is not allowed.


Bookmarks

Posting Permissions

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