View file forum/includes/other.php

File size: 2.28Kb
<?php
##################################
#           other.php            #
##################################
#   Форум на MySQL               #
#Афтар : Morgan                  #
#ICQ : 530-648                   #
#Email : [email protected]           #
##################################
######## подсчет OnLine
mysql_query("DELETE FROM online WHERE `time`+300 < ".time()." OR `ip` = '$ip'") ;
 // вставляем свою запись
mysql_query("INSERT INTO online SET `ip` = '$ip',`time`=".time().",`id_user`='$user_inf[id]'") or my_error();
// возвращаем результат



/*
if(!empty($_GET))
{
$text = $_GET;
if(stripos('select',$text))
{

exit('Обнаружена попытка SQL инъекции!<br />');

}
}
*/


  function antihack_enter()
{
if($_SESSION['antihack_enter']>3)
  {

if(!isset($_SESSION['antihack_enter_where'])) { $_SESSION['antihack_enter_where']=time(); }
$where = $_SESSION['antihack_enter_where']+900;
if( $where < time()  )
{

unset($_SESSION['antihack_enter_where']);
unset($_SESSION['antihack_enter']);

}
else
{
exit ('<h1>Вы были забанены!</h1><br />
До конца бана осталось <b>'.($where-time()).'</b> секунд');
}

}

}

  function antihack_ip_ua()
{

if(!isset($_SERVER['REMOTE_ADDR']) or empty($_SERVER['REMOTE_ADDR']) or $_SERVER['REMOTE_ADDR']=='' or !isset($_SERVER['HTTP_USER_AGENT']) or empty($_SERVER['HTTP_USER_AGENT']) or $_SERVER['HTTP_USER_AGENT']=='')
{
exit('<h1>А где IP и User Agent ?</h1>');
}
}

  function delay()
{
if(($_SESSION['delay']+900) < time())
{

session_unset();
session_destroy();

}
else
{
$_SESSION['delay']=time();
}

}

Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);


if($status == 'logined')
{

if(isset($user_inf) and !empty($user_inf))
{

if(isset($user_inf['login']) and isset($user_inf['id']) and isset($user_inf['pass']) and !empty($user_inf['login']) and !empty($user_inf['id']) and !empty($user_inf['pass']))
{



}
else{ session_unset(); session_destroy(); }

}
else{ session_unset(); session_destroy(); }

}

##################################
#      © Все права защищены      #
##################################
?>