Просмотр файла lib/out.php

Размер файла: 1.57Kb
<?php
if (! defined ( 'CATALOGDEEP' )) {
	die ( "Hacking attempt!" );
}
$date = time();
$id = abs((int)$_GET['id']);
if(empty($id)){
	header ("Location: http://".$_SERVER['SERVER_NAME']);
	die();	
	}else{
		$sql = mysql_query("SELECT `ids` FROM `cat_ip` WHERE INET_ATON('".getenv('REMOTE_ADDR')."') BETWEEN `ip1` AND `ip2`;");

                if(mysql_num_rows($sql) > 0)
                {
                $operator = mysql_result($sql, 0);
                }
                else
                {
                $operator = 0;
                }
			$sql = mysql_query("SELECT * FROM `cat_opsos_out` WHERE `ip` = INET_ATON('".getenv('REMOTE_ADDR')."') AND `idsite` = '".$id."'");
	if(mysql_num_rows($sql) == 0){
		if(detect_mobile_device()){	
$sql = mysql_query("SELECT * FROM `cat_opsos_out` WHERE `opsos` = '".$operator."' AND `isite` = '".$id."'");
if(mysql_num_rows($sql) > 0){
	$sql = mysql_query("UPDATE `cat_opsos_out` SET `out` = (`in` + 1) WHERE `opsos` = '".$operator."'");
	}else{
$sql = mysql_query("INSERT INTO `cat_opsos_out` SET `ip` = INET_ATON('".getenv('REMOTE_ADDR')."'), `opsos` = '".$operator."', `date` = '".$date."', `idsite` = '".$id."', `out` = '1'");
}
$sql = mysql_query("UPDATE `cat_users` SET `out` = (`out` + 1), `outall` = (`outall` + 1) WHERE `id` = '".$id."'");
}
}
$query = mysql_query("SELECT * FROM `cat_users` WHERE `id` = '".$id."'");
$row = mysql_fetch_assoc($query);
header ("Location: http://".$row['url']);

die();	

}
/**********************/
/*Нарушение авторских прав, приследуется темной за углом*/
/*(с) govnokod by DeeP      http://lovap.ru             */
?>