Размер файла: 1.24Kb
<?
session_start(); //инициализирум механизм сесссий
include 'include/stat.php';
if (!isset($_SESSION['id']))
{
header ("location: logout.php");
exit('incorrect');
}
include 'include/sys.php';
include 'include/game.php';
if (isset($_GET['to']))
{
$to=def($_GET['to']);
}
if ($_GET['stat']=='send')
{
$from_id = $_SESSION['id'];
$to_id = def($_POST['to_id']);
$subj = def($_POST['subj']);
$msg = def($_POST['msg']);
count_query("INSERT INTO mail (from_id,to_id,subj,msg)
VALUES ('$from_id','$to_id','$subj','$msg')");
}
$res =@mysql_fetch_array(count_query("SELECT count(*)
FROM mail
WHERE to_id = '".$_SESSION['id']."'"));
if ($res['count(*)']=='')
{
$res['count(*)']=0;
}
?>
<?include 'include/head.php';
include'include/menu.php';?>
<div class="in">Написать сообщение</div>
<form action="msgnew.php?stat=send" method="POST">ID игрока (кому)</br><input type=text name="to_id" size=30 maxlength=30 class="input" value="<?=$to;?>"><br>Тема (100 симв.)</br><input type=text name="subj" size=30 maxlength=30 class="input" value=""></br>Сообщение<br><textarea name="msg" rows=9 cols=60 class="input"></textarea></br><input type=submit class="input" value="отправить"></form>
<?include 'include/foot.php';?>