Просмотр файла k/v.php

Размер файла: 2.08Kb
<?php
include "db.php";
####################################
//Антинакрутка
include("anti.php");
####################################
if(checkuser())
{
$go = mysql_connect ($DB_HOST, $DB_USER, $DB_PASS); //соединяемся с сервером базы данных
mysql_select_db($DB_NAME);   //выбираем базу данных
$agent = getenv("HTTP_USER_AGENT");
$ip = getenv("REMOTE_ADDR");
$soft = ("$agent||$ip");
$date = date("Y-m-d");
$qu = @mysql_query("SELECT `id`,`title`,`link`,`counter`,`date`,`soft` FROM `users` WHERE id='".$id."';");
$sqlar  = @mysql_fetch_array($qu);
if(!empty($id) && $id==$sqlar['id']) {
if($date !== $sqlar['date']){
@mysql_query("update `users` set `date`='$date', `counter`='0', where 1;"); }
$q = @mysql_query("SELECT `counter` FROM `users` WHERE id='".$id."';");
$sqlid = @mysql_fetch_array($q);
$counter = $sqlid['counter'];
if($soft !== $sqlar['soft']) {
$counter++;
}
@mysql_query("UPDATE `users` SET `date`='$date', `counter`='$counter', `soft`='$soft' WHERE id=$id;");
if ($counter >= 0 && $counter < 10)
$pos_counter = 70;
if ($counter >= 10 && $counter < 100)
$pos_counter = 65;
if ($counter >= 100 && $counter < 1000)
$pos_counter = 60;
if ($counter >= 1000 && $counter < 10000)
$pos_counter = 55;
if ($counter >= 10000 && $counter < 100000)
$pos_counter = 50;
if ($counter >= 100000 && $counter < 1000000)
$pos_counter = 45;
if ($counter >= 1000000 && $counter < 10000000)
$pos_counter = 40;
if ($counter >= 10000000 && $counter < 100000000)
$pos_counter = 35;
if ($counter >= 100000000 && $counter < 1000000000)
$pos_counter = 30;
if ($counter >= 1000000000 && $counter < 10000000000)
$pos_counter = 25;
if ($counter >= 10000000000 && $counter < 100000000000)
$pos_counter = 20;
switch($i) {
default:
header ('Location: index.php?site='.urlencode(convert_cyr_string($sqlar['title'], 'a', 'w')).'&link='.$sqlar['link']); exit;
break;
}
}else{
switch($i) {
default:
header ("Location: http://guwap.org/kat/"); exit;
break;
}}
}
else
{ header ("Location: http://guwap.org/kat/"); exit;
}
?>