View Single Post
Old 07-15-2004, 01:05 PM  
badmrfrosty
Confirmed User
 
Join Date: May 2003
Posts: 500
Little traffic trader "skim dealy" i wrote.

<?
include ('config.php');

$magicnumber = rand(1, 4);
$a[1] = "http://www.shemp.com";
$a[2] = "http://www.thehun.net";
$a[3] = "http://www.snakesworld.com";
$a[4] = "http://www.msnbc.com"; #hah!
$link = "".$a[$magicnumber]."";

#increment global outgoing click counter
$query9 = "UPDATE clicks set num = num + 1 where id = 1";
$result9 = mysql_query($query9);

#check to see how many hits we have
$query10 = "SELECT * from clicks where id = '1'";
$result10 = mysql_query($query10);
while ($row = mysql_fetch_array($result10)) {
$thenumber = $row['num'];
}
if ($thenumber % 2 [equal][equal] 0) {
$loc = "".$link."";
} else {
$loc = $_GET['loc'];
}
#check to see if we've sent any traffic to that URL yet!
$query2 = "SELECT * from traffic where location = '".$loc."'";
$result5 = mysql_query($query2);
$num_rows = mysql_num_rows($result5);
if ($num_rows [equal][equal] '0') {
$createrow = "INSERT INTO traffic VALUES(NULL, '$loc', '1')";
$result = mysql_query($createrow);
header("Location: {$loc}");
exit();
} else {
$updaterow = "UPDATE traffic SET count = count + 1 where location =
'".$loc."'";
$result = mysql_query($updaterow);
header("Location: {$loc}");
exit();
}
?>

all you have to do is make your links on your tgp go.php?loc=(whatever) and you have mad outgoing skim! ;-)

the

oh yeah and it needs two tables.

thenum % 2 means that 50% of the time its going to to go skim

if anyone just wants the damn file email me :D

BMF

Last edited by badmrfrosty; 07-15-2004 at 01:09 PM..
badmrfrosty is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote