Файл: cabn/mp.php
Строк: 15
<?php
session_name('SID') . session_start();
include '../inc/head.php';
if(isset($_GET['id'])){
if(isset($_GET['us'])){
if(isset($_GET['sid'])){
$us=$_GET['us'];
$ip=$_SERVER['REMOTE_ADDR'];
$go=$_GET['id'];
$data = mysql_query("SELECT * FROM `rek` WHERE `ok`>NOW() AND `id` = '".$go."' AND `ball` >= '1' ORDER BY RAND() LIMIT 1");
while ($row = mysql_fetch_assoc($data)){
if (isset($active) == false){
if ($_SESSION['sid'] != $_GET['sid']){
header ('location: '.$row['url'].'');
} else {
$up = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$us."' AND `ip` = '".$ip."'"));
$f = mysql_fetch_assoc(mysql_query("SELECT * FROM `go` WHERE `go` = '".$go."' AND `ip` = '".$ip."'"));
if (!$up['login']){
if (!$f['go']){
mysql_query("UPDATE `rek` SET `go` = `go` + '1' WHERE `id` = '".$row['id']."'");
mysql_query("UPDATE `rek` SET `ball` = `ball` - '1' WHERE `id` = '".$row['id']."'");
mysql_query("UPDATE `clicks` SET `go` = `go` + '1'");
mysql_query("INSERT INTO `go` SET `go` = '".$row['id']."', `ip` = '".$ip."'");
mysql_query("INSERT INTO `pp_click` SET `go` = '".$row['id']."', `us` = '".$us."'");
mysql_query("UPDATE `users` SET `money` = `money` + '0.05' WHERE `id` = '".$us."' LIMIT 1");
header ('location: '.$row['url'].'');
} else {
header ('location: '.$row['url'].'');
}
} else {
header ('location: '.$row['url'].'');
}
}
unset($_SESSION['sid']);
} else {
header ('location: '.$row['url'].'');
}
}
}
}
}
?>