Просмотр файла wapforum2/newthread.php

Размер файла: 2.22Kb
<?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("&lt;","",$tname);
         $tname=str_replace("<","",$tname);
         $tname=str_replace(">","",$tname);
         $tname=str_replace("&gt;","",$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&amp;name=$tname&amp;nick=$nick&amp;pass=$pass&amp;read=new&amp;forumas=$forumas&amp;page=1\">&#x41F;&#x43E;&#x441;&#x43C;&#x43E;&#x442;&#x440;&#x435;&#x442;&#x44C; &#x441;&#x43E;&#x43E;&#x431;&#x449;&#x435;&#x43D;&#x438;&#x435;</a><br/>";
echo "<a href=\"index.php?action=viewforum&amp;nick=$nick&amp;pass=$pass&amp;id=$forumas&amp;page=1\">&#x412;&#x435;&#x440;&#x43D;&#x443;&#x442;&#x44C;&#x441;&#x44F; &#x432; &#x444;&#x43E;&#x440;&#x443;&#x43C;</a><br/>";
echo "<a href=\"index.php?nick=$nick&amp;pass=$pass\">BACK</a>";
?>
</p>
</card>
</wml>