<?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="";
$ttext=$_POST["ttext"];
$name=$_POST["name"];
$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);
//$name=base64_decode($name);
echo login($nick,$pass);
echo "<br/><br/>";
global $logged;
if ($logged)
{
$isclosed=mysql_fetch_array(mysql_query("SELECT closed FROM posts WHERE name='".$name."' AND thread='1'"));
if ($isclosed[0] != 1) {
$phone = explode(" ",$HTTP_USER_AGENT);
$phone = $phone[0];
echo post(0,$nick,$pass,$name,$ttext,$forumas,$phone);
echo "<br/>";
} else {ismod($nick,$pass,$forumas);
global $moderator;
if ($moderator) {$phone = explode(" ",$HTTP_USER_AGENT);
$phone = $phone[0];
echo post(0,$nick,$pass,$name,$ttext,$forumas,$phone);
echo "<br/>";} else echo "Thread closed!<br/>"; }
} else echo "Please login first!<br/>";
$name=substr($name,0,31);
$ttext=str_replace("$","-",$ttext);
$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);
$name=base64_encode($name);
if ($logged) echo "<a href=\"index.php?action=viewpost&name=$name&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>