I am looking for a way to track the number of people sent from my site to another site via a link. Another words, how many people who were at my site clicked on the link that then took them to a different site.
I am looking for a way to track the number of people sent from my site to another site via a link. Another words, how many people who were at my site clicked on the link that then took them to a different site.
Well, you could make a PHP script that stores the info in a MySQL database. Just make your links something like this:
and use this as a basis for the php script:Code:<a href="http://example.com/affiliate.php?url=http://blah.org/">blah.org</a>
affiliate.php
Hope this helps.Code:<?php $url = $_POST['url']; $conn = mysql_connect('localhost', 'username', 'password'); mysql_select_db('database', $conn); $info = mysql_query("SELECT * FROM `table` WHERE `url`='$url'"); $q = mysql_fetch_array($info); $count = $q['count']; $count = $count+1; mysql_query("UPDATE `table` SET `count`='$count' WHERE `url`='$url'"); header('Location: '.$url); ?>
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Bookmarks