View file adv/index.php

File size: 603B
<?php
include '../system/start.php';

$id=fint($_GET[id]);
$ldata=@mysql_fetch_array(mysql_query("SELECT `url` FROM `promo_link` WHERE `id`='$id' LIMIT 1;"));


if(!empty($ldata[url])){

if(bot(getenv("HTTP_USER_AGENT"))==false){
  //прибавляем переход
mysql_query("UPDATE `promo_link` SET `count`=`count`+1 WHERE `id`='$id';");
  //статистика
mysql_query("INSERT INTO `promo_count` SET `lid`='$id', `ip`='$user[ip]', `ua`='$user[ua]', `time`='".time()."';");
  //переход
   header("Location: http://$ldata[url]");
}
}
else{
   myheader("");
}

?>