Вход Регистрация
Файл: accmarket.net/mod/index.php
Строк: 53
<?
    define
('_ON_CMS'1);
    
$rootpath '../';
    require_once 
'../includes/start.php';
    require_once 
'../includes/function.php';
    require_once 
'../includes/header.php';
    if(
$level<5){
   
header('Location: ../index.php');
   }
    echo 
'<div class="top">Модерская ('.adm($level).')</div>';
    if(
$level>=6){
    if(!
$_POST)
    {

            echo 
'<div class="cont"><form action="" method="POST">
            <input type="text" value="" name="text" />
            <select name="type"><option value="1">Планета</option><option value="2">Игрок</option></select>
            <input type="submit" name="submit" value="Проверить"/></form></div>'
;

    }
    else
    {
            
$text check(trim($_POST['text']));
            
$type check(trim($_POST['type']));
            
$error false;
        
                if (empty(
$text))
            
$error $error 'Не введен текст<br/>';
        elseif (
strlen($text) > 100)
            
$error $error 'Слишком длинное название!<br />';
        elseif (
strlen($text) < 2)
            
$error $error 'Слишком короткое название!<br />';
        elseif (
preg_match('/[^a-zA-Zа-яА-Я0-9]+/=:',$text))
            
$error $error 'Недопустимые символы в названии<br />';

            if (empty(
$type))
            
$error $error 'Не выбран тип<br/>';
            if (
$type<OR $type>2)
            
$error $error 'Не верный тип<br/>';
            
        if(
$type==1){
        
$q mysql_query("SELECT * FROM `planet` WHERE `name`='".check(mysql_real_escape_string($text))."'");
        
$f mysql_fetch_array($q);    }
        if(
$type==2){
        
$q mysql_query("SELECT * FROM `users` WHERE `login`='".check(mysql_real_escape_string($text))."'");
        
$f mysql_fetch_array($q);    }


        
              if (empty(
$error))
        {
                        
        if(
$type==1)header('Location: info.php?id='.$f['id'].'');
        if(
$type==2)header('Location: user.php?id='.$f['id'].'');
        }
        else
        {
            
header('Location: index.php');
        }
    }
    }
    echo 
'<div class="conts">';
            echo 
'<img src="../images/menu.png" alt="" /> <a href="apanel.php"> Панель управления</a><br/>';

    
$count mysql_result(mysql_query("SELECT COUNT(*) FROM `mod_chat` WHERE `time` > '" . ($realtime 86400) . "';"), 0);
    echo 
'<img src="../images/menu.png" alt="" /> <a href="sov.php">Совещание</a>';
    if(
$count>0)echo ' [+'.$count.']';
    echo 
'<br/>';
    echo 
'<img src="../images/menu.png" alt="" /> <a href="banlist.php">Забаненные</a><br/>';
    if(
$level>=6)echo '<img src="../images/menu.png" alt="" /> <a href="planets.php">Планеты</a>';
    echo 
'</div>';
            
div('<a href="../">В игру</a>','conts');
    require_once 
'../includes/footer.php';
?>
Онлайн: 0
Реклама