Heres an example to track what links get clicked on your website! ( simple script, needs php & mysql )
You need this table :
its a table with an ID, a date ( when user clicked the link, can later be used to build graphical charts on date) url ( the clicked url, ) referer ( the referring url ) and ofcourse the IP.
The tracking script : track.php
an url gets called like this :
this is the example for an inbound link, for outbound links use this :
Heres my example site using this script : http://www.trafficexploit.co.cc
You need this table :
Code:
DROP TABLE IF EXISTS `traffic_exploit`;
CREATE TABLE `traffic_exploit` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`date` datetime DEFAULT NULL,
`url` varchar(555) DEFAULT NULL,
`referer` varchar(555) DEFAULT NULL,
`ip` varchar(15) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
The tracking script : track.php
PHP:
<?php
if (isset($_GET['url']))
{
mysql_connect("localhost","root","");
mysql_selectdb("traffic****");
$url = mysql_escape_string($_GET['url']);
$ip = $_SERVER['REMOTE_ADDR'];
$referer = $_SERVER['HTTP_REFERER'];
$query = "INSERT INTO traffic_exploit (ip,date,url,referer) VALUES ('$ip',now(),'$url','$referer')";
mysql_query($query);
header("location:$url");
}
?>
an url gets called like this :
PHP:
<a href="track.php?url=good-traffic-exchange-websites.php" target="_blank" style="color:#375468;">Good Traffic exchange sites</a>
PHP:
<a href="track.php?url=http%3A%2F%2Fwww.trafficexploit.co.cc" target="_blank" style="font-size:12px;color:blue;margin-left:0px;">traffic exploit</a>
Heres my example site using this script : http://www.trafficexploit.co.cc
Last edited: