Просмотр файла click_club/ban.php

Размер файла: 1.15Kb
<?
if ($_SERVER['HTTP_X_FORWARDED_FOR'])
{ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR'];}

$login=$_SESSION['login'];

$banus=mysql_query("select * from `ban` where name='$login'");
$bann=mysql_num_rows($banus);
if($bann>0)
{header ("Location: ban.html");  exit;}

$banip=mysql_query("select * from `ban` where ip='$ip'");
$bannn=mysql_num_rows($banip);
if($bannn>0)
{header ("Location: ban.html");  exit;}

$banlink=mysql_query("select * from `user` where login='$login'");
$linkrow = mysql_fetch_array($banlink);
$bannlink=mysql_query("select * from `ban` where link='$linkrow[url]'");
$bannnn=mysql_num_rows($bannlink);
if($bannnn>0)
{header ("Location: ban.html");  exit;}

$tr = mysql_query("select * from `user` where  login='$login';");
$dat = mysql_fetch_array($tr);


///////////////////
$k=mysql_query("select * from `narush` where name='$dat[login]'");
$row=mysql_num_rows($k);
if($row>0){
$urla=$dat['url'];
@mysql_query("update `narush` set  link='".$urla."', ip='".$ip."' where name='".$login."';"); }
else{mysql_query("insert into `narush` values(0,'$login','$data[url]','$useragent','$ip');");}


?>