<?
session_start();
$id = $_SESSION['id'];
$password = $_SESSION['password'];
if(isset($_POST['action']))
{
if($_POST['translit'] == "yes")
{
$lat = array("''", "'", "\"\"", "\"", "CH", "ch", "SC", "sc", "YE", "ye", "YU", "yu", "YA", "ya", "YO", "yo", "A", "a", "B", "b", "C", "c", "D", "d", "E", "e", "F", "f", "G", "g", "H", "h", "I", "i", "J", "j", "K", "k", "L", "l", "M", "m", "N", "n", "O", "o", "P", "p", "R", "r", "S", "s", "T", "t", "U", "u", "V", "v", "H", "h", "Z", "z", "W", "w", "X", "x", "Y", "y");
$rus = array("Ь", "ь", "Ъ", "ъ", "Ч", "ч", "Щ", "щ", "Э", "э", "Ю", "ю", "Я", "я", "Ё", "ё", "А", "а", "Б", "б", "Ц", "ц", "Д", "д", "Е", "е", "Ф", "ф", "Г", "г", "Х", "х", "И", "и", "Ж", "ж", "К", "к", "Л", "л", "М", "м", "Н", "н", "О", "о", "П", "п", "Р", "р", "С", "с", "Т", "т", "У", "у", "В", "в", "Х", "х", "З", "з", "Ш", "ш", "Ы", "ы", "Й", "й");
$_POST['nickname'] = str_replace($lat, $rus, $_POST['nickname']);
}
$nickname = mysql_escape_string($_POST['nickname']);
$password = mysql_escape_string($_POST['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `nickname` = '".$nickname."' AND `password` = '".$password."';");
}
else
{
//$id = intval($_GET['id']);
//$password = mysql_escape_string($_GET['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '".$id."' AND `password` = '".$password."';");
}
$user = mysql_fetch_array($q);
$id = $user['id'];
$nickname = $user['nickname'];
$level = $user['level'];
$status = $user['status'];
$time = $user['time'];
$fsize = $user['fsize'];
$ip = $user['ip'];
$ua = $user['ua'];
$security = $user['security'];
print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
print '
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xml:lang="ru" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="refresh" content="'.$refresh.'; url=./room.php?rid='.$rid.'&nocache='.$nocache.'" />
<title>Главная</title>
<style type="text/css">
body {font-size: small; font-family: sans-serif; font-weight: normal; color: #0f0f0f; background-color: #f0f0ff; margin: 0; padding: 1px}
div {margin: 0px 0px 0px 0px }
a {color:#3366cc; }
a:hover {color:#ff0000; }
a.h {color:#f0f0f0; }
a.h:hover {color:#b0b0b0; }
div.h {background-color: #00B09C; padding: 2px 2px 2px 2px; border-right: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0; text-align: left; }
</style>
</head>
<body>
<div><div class="h">';