Welcome
He writes a little script that will track clicks on the ads and also secured a double click. I wrote two tables I added to the principal called the “ad” on the link in the ad code. Please help me how to make accounted clicks.
[code=php]
include “config.php”;
$mysql=mysql_connect(mysql_host, mysql_user, mysql_password) or die(mysql_error());
mysql_select_db(mysql_db) or die(“SQL Died”);
if (!empty($_GET[‘visit’]))
{
$ad = $_GET[‘visit’];
$source = mysql_query(“SELECT * FROM ad WHERE aID=’$ad'”) or die(mysql_error());
$num_rows = mysql_num_rows($source);
if ($num_rows < 1) {
echo “Sorry, ad id not found in database”;
mysql_close($link);
}
else
{
$source = mysql_query(“SELECT * FROM ad where aID=’$ad'”) or die(mysql_error());
while($row = mysql_fetch_array( $source )) {
$type = $row[‘type’];
}
if($type == “tradedoubler”)
{
$source = mysql_query(“SELECT * FROM new where adId=’$ad’ and IP=’$usrip'”) or die(mysql_error());
$num_rows = mysql_num_rows($source);
if ($num_rows >= 1) {
mysql_close($conn);
echo “”;
}
else
{
$source = mysql_query(“SELECT * FROM ad WHERE aID=’$ad'”) or die(mysql_error());
while($row = mysql_fetch_array( $source )) {
$link = $row[‘link’];
}
mysql_query(“INSERT INTO new (`adId`, `IP`,`click`) VALUES (‘” . $ad . “‘, ‘”.$usrip.”‘, ‘1’);”) or die(mysql_error());
mysql_close($conn);
@header(“location:$link”);
}
}
}
else
{
?>
<?php
mysql_close($mysql);
}
?>
I found this [url]http://www.icemelon.com/tutorials/17/Track_Google_Adsense_Clicks.htm