this is in genproc.php
this is in index.php
echo "<center><form enctype=\"multipart/form-data\" action=\"genproc.php?action=post3\" method=\"post\">";
echo "Tekst:<input name=\"reptxt\" value=\"\" maxlength=\"500\"/><br/>";
echo "<input type=\"hidden\" name=\"tid\" value=\"$tid\"/>";
<br/><br/>File:<br/>";
echo "<input id=\"inputText\" type=\"file\" name=\"attach\"/><br/>";
echo "<input id=\"inputButton\" type=\"submit\" name=\"submit\" value=\"Send\"/>";
echo "</form></center>";
and this is tables.
CREATE TABLE IF NOT EXISTS `files` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`filename` varchar( 15 ) NOT NULL default '',
`extension` varchar( 5 ) NOT NULL default '',
`size` int( 11 ) NOT NULL default '0',
`origname` varchar( 50 ) NOT NULL default '',
PRIMARY KEY ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =268;
but i don't know how to show this in index.php?action=viewtpc ... pls help
.
else if($action=="post3")
{
$uid = getuid_sid($sid);
$descript = $_POST["descript"];
$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo xhtmlheadnotheme("$sitetitle");
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main\">Home</a>";
echo "</p>";
echo xhtmlfoot();
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Posted a Reply - xHTML:v3","");
echo "<head>\n";
echo "<title>$sitetitle</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
echo "</head>";
echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">posted reply</h1></td>";
echo "</tr>";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+10;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
echo "<br/><br/><a href=\"index.php?action=viewtpc&tid=$tid&g o=last\">";
echo "View Topic</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$size = $_FILES['attach']['size']/1024;
$origname = $_FILES['attach']['name'];
$ext = explode(".", strrev($origname));
switch(strtolower($ext[0])){
case "dim":
$res = true;
break;
case "3pm":
$res = true;
break;
case "mr":
$res = true;
break;
case "fdp":
$res = true;
break;
case "4pm":
$res = true;
break;
case "iva":
$res = true;
break;
case "rma":
$res = true;
break;
case "vaw":
$res = true;
break;
case "gpj":
$res = true;
break;
case "gnp":
$res = true;
break;
case "pmb":
$res = true;
break;
case "fig":
$res = true;
break;
case "pg3":
$res = true;
break;
case "piz":
$res = true;
break;
case "rar":
$res = true;
break;
case "sis":
$res = true;
break;
case "raj":
$res = true;
break;
case "exe":
$res = true;
break;
case "gepj":
$res = true;
break;
}
$tm = time();
$uploaddir = $mmsdir; //can be configured in config.php
$who = getuid_nick($pmtou);
echo "<p align=\"center\">";
if($size>804{
echo "File is larger than 8MB";
}
else if ($res!=true){
echo "File type not supported! Please attach only a JPG or JPEG or GIF or BMP or PNG or 3GP or MID or WAV or MP3 or MP4 or AVI or AMR or SIS or EXE or ZIP or JAR or RAR or PDF file";
}
$tid = $_POST["tid"];
$name = mysql_fetch_array(mysql_query("SELECT (MAX(id)+1) FROM files"));
$uploadfile = $name[0].".".strrev($ext[0]);
move_uploaded_file($_FILES['attach']['tmp_name'], "$uploaddir/$uploadfile");
$ext=strrev($ext[0]);
$res1 = mysql_query("INSERT INTO files SET uid='".$uid."', origname='".$origname."', filename='".$uploadfile."', size='$size', extension='".$ext."'");
if($res1){
echo "Poruka je poslata..";
}
else {
echo "Ne mozete upisati post...";
}
echo "</p>";
echo "<br/>";
echo "<a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo xhtmlfoot();
}
{
$uid = getuid_sid($sid);
$descript = $_POST["descript"];
$tid = $_POST["tid"];
$tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
if(!canaccess(getuid_sid($sid), $tfid[0]))
{
echo xhtmlheadnotheme("$sitetitle");
echo "<p align=\"center\">";
echo "You Don't Have A Permission To View The Contents Of This Forum<br/><br/>";
echo "<a href=\"index.php?action=main\">Home</a>";
echo "</p>";
echo xhtmlfoot();
exit();
}
$reptxt = $_POST["reptxt"];
$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Posted a Reply - xHTML:v3","");
echo "<head>\n";
echo "<title>$sitetitle</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
echo "</head>";
echo "<body>";
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
echo "<tr>";
echo "<td id=\"body\" width=\"159\">";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
echo "<tr>";
echo "<td class=\"boxedTitle\" height=\"20\">";
echo "<h1 align=\"center\" class=\"boxedTitleText\">posted reply</h1></td>";
echo "</tr>";
echo "<p align=\"center\">";
$crdate = time();
$fid = getfid($tid);
$res = false;
$closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));
if(($closed[0]!='1')||(ismod($uid)))
{
$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
global $post_af;
$antiflood = time()-$lpost[0];
if($antiflood>$post_af)
{
if(trim($reptxt)!="")
{
$res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'");
}
if($res)
{
$usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+10;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
echo "<br/><br/><a href=\"index.php?action=viewtpc&tid=$tid&g o=last\">";
echo "View Topic</a>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Error Posting Message";
}
}else{
$af = $post_af -$antiflood;
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Antiflood Control: $af";
}
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Topic is closed for posting";
}
$size = $_FILES['attach']['size']/1024;
$origname = $_FILES['attach']['name'];
$ext = explode(".", strrev($origname));
switch(strtolower($ext[0])){
case "dim":
$res = true;
break;
case "3pm":
$res = true;
break;
case "mr":
$res = true;
break;
case "fdp":
$res = true;
break;
case "4pm":
$res = true;
break;
case "iva":
$res = true;
break;
case "rma":
$res = true;
break;
case "vaw":
$res = true;
break;
case "gpj":
$res = true;
break;
case "gnp":
$res = true;
break;
case "pmb":
$res = true;
break;
case "fig":
$res = true;
break;
case "pg3":
$res = true;
break;
case "piz":
$res = true;
break;
case "rar":
$res = true;
break;
case "sis":
$res = true;
break;
case "raj":
$res = true;
break;
case "exe":
$res = true;
break;
case "gepj":
$res = true;
break;
}
$tm = time();
$uploaddir = $mmsdir; //can be configured in config.php
$who = getuid_nick($pmtou);
echo "<p align=\"center\">";
if($size>804{
echo "File is larger than 8MB";
}
else if ($res!=true){
echo "File type not supported! Please attach only a JPG or JPEG or GIF or BMP or PNG or 3GP or MID or WAV or MP3 or MP4 or AVI or AMR or SIS or EXE or ZIP or JAR or RAR or PDF file";
}
$tid = $_POST["tid"];
$name = mysql_fetch_array(mysql_query("SELECT (MAX(id)+1) FROM files"));
$uploadfile = $name[0].".".strrev($ext[0]);
move_uploaded_file($_FILES['attach']['tmp_name'], "$uploaddir/$uploadfile");
$ext=strrev($ext[0]);
$res1 = mysql_query("INSERT INTO files SET uid='".$uid."', origname='".$origname."', filename='".$uploadfile."', size='$size', extension='".$ext."'");
if($res1){
echo "Poruka je poslata..";
}
else {
echo "Ne mozete upisati post...";
}
echo "</p>";
echo "<br/>";
echo "<a href=\"index.php?action=main\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo xhtmlfoot();
}
this is in index.php
echo "<center><form enctype=\"multipart/form-data\" action=\"genproc.php?action=post3\" method=\"post\">";
echo "Tekst:<input name=\"reptxt\" value=\"\" maxlength=\"500\"/><br/>";
echo "<input type=\"hidden\" name=\"tid\" value=\"$tid\"/>";
<br/><br/>File:<br/>";
echo "<input id=\"inputText\" type=\"file\" name=\"attach\"/><br/>";
echo "<input id=\"inputButton\" type=\"submit\" name=\"submit\" value=\"Send\"/>";
echo "</form></center>";
CREATE TABLE IF NOT EXISTS `files` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`filename` varchar( 15 ) NOT NULL default '',
`extension` varchar( 5 ) NOT NULL default '',
`size` int( 11 ) NOT NULL default '0',
`origname` varchar( 50 ) NOT NULL default '',
PRIMARY KEY ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =268;
but i don't know how to show this in index.php?action=viewtpc ... pls help
.
Comment