<?

header('Cache-Control: no-store, no-cache, must-revalidate');
if ($ver=="wml")header ("Content-type:text/vnd.wap.wml; charset=utf-8");
else header("Content-Type:text/html; charset=UTF-8");

require("inc.php");

$link = connect_db();
list($row, $id, $ps, $fsize1, $fsize2) = check_login($link);
require("version.php");

if(isset($HTTP_GET_VARS['rm'])) {$rm = $HTTP_GET_VARS['rm'];}
if (!ctype_digit($rm)) { header("Location: index.php"); die; }
$rm = mysql_escape_string($rm);

if($rm==10) $takep="&amp;ref=$ref&amp;pwd=$pwd";
else $takep="&amp;ref=$ref";

ob_start();
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
echo "<head><link rel=\"stylesheet\" type=\"text/css\" href=\"css/css.css\"/>";
echo "<title>Сказать</title>";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>";
echo "<div align=\"left\">";
echo "<form method=\"POST\" action=\"chat.php?$ses&amp;rm=$rm$takep\" name=\"auth\">\n";
echo $fsize1;
echo "Текст<br/>\n";
echo $fsize2;
echo "<input type=text name=msg maxlength=\"200\"><br/>";
if ($rm!=23){ 
if ($row["level"]>=4){
echo $fsize1;
echo "Шрифт<br/>\n";
echo $fsize2;
echo "<select name=\"shrift\">\n";
echo "<option value=\"0\">Обычный</option>\n";
echo "<option value=\"1\">Наклонный</option>\n";
}
if ($row["level"]>=5) {echo "<option value=\"2\">Подчёркнутый</option>\n";}
if ($row["level"]>=6) {echo "<option value=\"3\">Накл. и подч.</option>\n";}
if ($row["level"]>=6) {echo "<option value=\"4\">Жирный</option>\n";}
if ($row["level"]>=7) {echo "<option value=\"5\">Жирн. и подч.</option>\n";}
if ($row["level"]>=7) {echo "<option value=\"6\">Огромный</option>\n";}
if ($row["level"]>=4) {echo "</select><br/>\n";}
}
echo "<input type=\"submit\" value=\"Сказать\" name=\"enter\"></form>\n";
echo $divide;
if ($rm==23) echo "<a href=chat.php?$ses&amp;rm=$rm$takep method=post title=\"В чат\"><input type=submit value=\"В игру\"></a>";
else echo "<a href=chat.php?$ses&amp;rm=$rm$takep method=post title=\"В чат\"><input type=submit value=\"В чат\"></a>";
echo "</div>";
echo "</BODY>\n"; 
echo "</HTML>\n";
$alltraf=$row["alltraf"];
$pagesize=round((ob_get_length())/1024,1);
$alltraf=$alltraf+$pagesize;
mysql_query ("Update users set alltraf='".$alltraf."', lasttraf='".$pagesize."' where id='".$id."'");
mysql_close ($link);
ob_end_flush();
?>