<?php
header("Content-type: text/vnd.wap.wml");
print "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="login" title="WAP FORUMS">
<p align="center">
<?php
$nick=$_GET["nick"];
$pass=$_GET["pass"];
$tname=$_POST["tname"];
$ttext=$_POST["ttext"];
$forumas=$_GET["forumas"];
include("core.php"); //load main functions
include("conf.php"); //load config
str_replace("$","\$",$tname);
str_replace("$","$$",$ttext);
echo connect($dbuser,$dbpass,$dbserver,$dbname);
echo login($nick,$pass);
echo "<br/><br/>";
global $logged;
if ($logged)
{
canuppost($nick,$pass,$forumas);
global $postlet;
if ($postlet) {
$phone = explode(" ",$HTTP_USER_AGENT);
$phone = $phone[0];
echo post(1,$nick,$pass,$tname,$ttext,$forumas,$phone);
echo "<br/>";
} else echo "You are not allowed to create a thread here!<br/>";
} else echo "Please login first!<br/>";
$tname=htmlspecialchars($tname);
$tname=substr($tname,0,31);
$tname=str_replace("$","",$tname);
$tname=str_replace("<","",$tname);
$tname=str_replace("<","",$tname);
$tname=str_replace(">","",$tname);
$tname=str_replace(">","",$tname);
$tname=str_replace("\"","",$tname);
$tname=str_replace("'","",$tname);
$tname=str_replace("\\","",$tname);
$tname=str_replace("&","",$tname);
//$tname=mysql_fetch_array(mysql_query("SELECT name FROM posts WHERE text='".$ttext."'"));
$tname=base64_encode($tname);
if ($logged) echo "<a href=\"index.php?action=viewpost&name=$tname&nick=$nick&pass=$pass&read=new&forumas=$forumas&page=1\">Посмотреть сообщение</a><br/>";
echo "<a href=\"index.php?action=viewforum&nick=$nick&pass=$pass&id=$forumas&page=1\">Вернуться в форум</a><br/>";
echo "<a href=\"index.php?nick=$nick&pass=$pass\">BACK</a>";
?>
</p>
</card>
</wml>