Файл: anibiliwar.ru/admin/mailfromsys.php
Строк: 41
<? 
include_once '../system/common.php'; 
include_once '../system/functions.php';
include_once '../system/user.php'; 
if(!$user OR $user['access']!='1'){ 
    header("Location:/"); 
    exit; 
} 
$title='Написать с системы'; 
include_once '../system/h.php'; 
if(isset($_GET['send'])){ 
    $login=_string($_POST['login']); 
    $text=_string($_POST['msg']); 
    $usto=mysql_fetch_array(mysql_query("SELECT `login`,`id`,`save` FROM `users` WHERE `login`='$nick' and `save`='1'"));
    if(!$usto){ 
        $_SESSION['light']="Пользователь не найден.";
        header('location:?'); 
        exit; 
    } 
    mysql_query("INSERT INTO `mail` SET `from`='3',`to`='".$usto['id']."',`text`='$text',`time`='".time()."'");
    if(mysql_num_rows(mysql_query("SELECT * FrOM `contacts` WHERE `ho`='3' and `user`='".$usto['id']."'"))==0){ 
    mysql_query("INSERT INTO `contacts` SET `ho`='3',`user`='".$usto['id']."',`time`='".time()."'"); 
    }else{ 
    mysql_query("UPDATE `contacts` SET `time`='".time()."' WHERE `ho`='3' and `user`='".$usto['id']."'");    
    } 
    $_SESSION['light']="Сообщение доставлено";
    header('location:?'); 
} 
?> 
<div class='content'/> 
<left> 
<form action='?send' method='post'/> 
<input type='text' name='login' placeholder='Кому Ник'/><br/> 
<textarea type='text' name='msg' placeholder='Введите Ваше сообщение' rows='4' cols='50'/></textarea><br/> 
<input type='submit' value='Отправить'/>
</form> 
</left> 
</div> 
<? 
include_once '../system/f.php'; 
?>