<?php
if(empty($to)) $error=$error."Sorry,Send To is Empty,Check Again !<br/>";
if(empty($subject)) $error=$error."Sorry Subject is Empty,Check Now !<br/>";
if(empty($letter)) $error=$error."Sorry,Message is empty there !<br/>";
// Main Header of Site
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
// Decode type of site
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>';
// including Database file
include "../ini.php";
// for login detail
$login = autorize();
// For Header of Page
print '<card title="Fun-ChaT">'.
'<p align="center">';
$query_to = mysql_query("select * from `".$px.$utable."` where login='".$to."' and ci='$ci';");
$to_data = mysql_fetch_array($query_to);
// If Nt Login 
if(empty($id))
print " Sorry You Are Nt Login !<br/>";
// Login
if($login) {
// Login Error
if(!empty($error)) { print $error; } else {
if($to == $to_data['login']) {
// Check Datails
@mysql_query("insert into `".$px.$ltable."` values(0,'".$login['login']."','$to','$subject','$letter','".time()."',1,'$ci');");
// Data base Connector
print "<b>Message Sent!</b><br/>"; } else {
print "<b>Message Nt Sent Try Again</b><br/>";
}
}
print "<anchor>Back<prev/></anchor><br/>";
// Go to hall
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>';
// The end of page
@mysql_close();
ob_end_flush();
?>