<?

header("Cache-Control: no-cache");
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 ($ver=="wml"){
echo $xml;
echo $dtd;
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"int\" title=\"Ключ\">\n";
echo "<p align=\"center\">\n";
echo $fsize1;
echo "Ключ:<br/>\n";
echo $fsize2;
echo "<input name=\"pwd$ref\" maxlength=\"12\" title=\"Kluch\"/><br/>\n";
echo $fsize1;
echo "<anchor title=\"go\">Войти<go href=\"chat.php?$ses&amp;rm=10&amp;pwd=$pwd&amp;ref=$ref\" method=\"post\">\n";
echo "<postfield name=\"pwd\" value=\"$(pwd$ref)\"/>\n";
echo "</go></anchor>\n";
echo $fsize2;
echo "<br/>\n";
echo $fsize1;
echo $divide;
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">Прихожая</a><br/>";
echo $fsize2;
echo "</p></card></wml>";
}else{
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=\"center\">";
echo "<form action=chat.php?$ses&amp;rm=10&amp;pwd=$pwd&amp;ref=$ref method=post title=\"Войти\">\n";
echo $fsize1;
echo "Ключ:<br/>\n";
echo $fsize2;
echo "<input name=\"pwd\" maxlength=\"12\" title=\"Kluch\"/><br/>\n";
echo "<input type=submit value=\"Войти\"/></form><br/>\n";
echo $fsize1;
echo $divide;
echo "<a href=\"enter.php?$ses&amp;ref=$ref\">Прихожая</a><br/>";
echo $fsize2;
echo "</div></body></html>";
}
mysql_close ($link); 
exit;
?>