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

Размер файла: 2.06Kb
<?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,$fid);
echo "<br/><br/>";
global $logged;
if ($logged)
   {
   canuppost($nick,$pass,$forumas,$fid);
   global $postlet;
   if ($postlet) {
             $phone = explode(" ",$HTTP_USER_AGENT);
                                                        $phone = $phone[0];

echo post(1,$nick,$pass,$tname,$ttext,$forumas,$phone,$fid);
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&amp;fid=$fid\">View thread</a><br/>";
echo "<a href=\"index.php?action=viewforum&amp;nick=$nick&amp;pass=$pass&amp;id=$forumas&amp;page=1&amp;fid=$fid\">Back to forum</a><br/>";
echo "<a href=\"index.php?nick=$nick&amp;pass=$pass&amp;fid=$fid\">BACK</a>";
?>
</p>
</card>
</wml>