|
AC,
Here is the code I found, please let me know if this is the right code. Thanks!
-------------------------------------------
if ($clickvalue > 0) /// this is what we do if it is a perclick program
{
if ($storedtime <= $systemtime)
{
$q1="insert into clicks (affID,merID,adID,IP,price,proID,refURL,time,paid) values ($affID,$merID,$adID,'$ip',$clickvalue,$proID,'$re f',now(),$clickapr)";
//echo $q1;
mysql_query ($q1) or die(mysql_error());
$result=mysql_query ("SELECT CID FROM clicks where IP = '$ip' order by time desc") or die(mysql_error());
$i = mysql_fetch_row($result);
$CID = $i[0];
/* Updates the info in Affiliate Table */
update_affstats($affID,$merID);
//setcookie ("GF", "CID:$CID",time()+2592000);
//echo "Set cookie:".$CID;
//header("location:$URL");
}
}
mysql_query ("insert into clickthroughs (affID,merID,adID,IP,proID,refURL,time) values ($affID,$merID,$adID,'$ip',$proID,'$ref',now())") or die(mysql_error());
$result=mysql_query ("SELECT CTID FROM clickthroughs where IP = '$ip' order by time desc") or die(mysql_error());
$i = mysql_fetch_row($result);
$CTID = $i[0];
$cookiename="GF".$merID;
setcookie ($cookiename, "CTID:$CTID","$cookiedays");
if ($adtype == 'html')
{
print "<script language = 'javascript'> window.close(); </script>";
exit;
}
header("location:$URL");
|