<?php

header ("Content-type:text/vnd.wap.wml; charset=utf-8");

print '<?xml version="1.0" encoding="utf-8"?>'.
'<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"'.
' "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
// database file
include "../ini.php";
// login info
$login = autorize();
// title info
print '<card title="Fun-ChaT">'.
'<p>';
// when login 
if($login) {
// view able file
@mysql_query("update `".$px.$ltable."` set new=0 where id='$id_letter' and ci='$ci';");
$query = @mysql_query("select * from `".$px.$ltable."` where id='$id_letter' and ci='$ci';");
$letter = @mysql_fetch_array($query);
// time and date
$time = date("d.m.Y H:i",$letter['time']);
// mess info
print "[".$time."]<br/><u>From:</u> ".$letter['from_user']."<br/><u>Subject:</u> ".$letter['subject']."<br/><u>Message:</u> ".$letter['letter'];
print "<br/><a href=\"sendform.php?ci=$ci&amp;id=$id&amp;pass=$pass&amp;to=".$letter['from_user']."\">Compose</a><br/>";
print "<anchor>Back<prev/></anchor><br/>******<br/>";
print "<a href=\"../enter.php?ci=$ci&amp;id=$id&amp;pass=$pass\">Hall</a><br/>";
} else { print "Sorry Nt Login , Try Again !"; }
print '</p>'.
'</card>'.
'</wml>';
// end of script
@mysql_close();
ob_end_flush();
?>
