Subject is empty, please enter all the field values to submit your post"; } } else { echo "Message is empty, please enter all the field values to submit your post"; } } function editpost() { $postedby=$_POST['PostedBy']; $pemail=$_POST['Email']; $subject=$_POST['Subject']; $edays=$_POST['edays']; $edays=(int) $edays; $body=$_POST['Body']; $ForumID=$_POST['ForumID']; $id=$_REQUEST['ForumID']; $sfid=$_SESSION['sfid']; //$_SESSION["id"]=$id; $mid=$_POST['mid']; $pdate=date("Y-m-d h:s:m"); //echo $subject; $sql=mysql_query("update messages set Subject='".$subject."',Body='".$body."',Date='".$pdate."' where MessageID=$mid"); $sql1=mysql_query("select * from messages where ForumID=$id order by Date desc"); // $postno=mysql_num_rows($sql1); $sql2=mysql_query("update forums set Posts=$postno ,LastPost='".$pdate."' where ForumID=$id"); header("Location:forum.php?ForumID=$id&sfid=$sfid"); } /* Index and forum */ //$ri=1; function showmsg($node,$level) { $sfid=$_REQUEST['sfid']; $id=$_REQUEST['ForumID']; $_SESSION["id"]=$id; $ForumID=$_SESSION['id']; $msg=mysql_query("select MessageID, InReplyTo, PostedBy, Email, Subject, Body, date_format(Date,'%d-%M-%Y %h:%i:%S %p') as idate, edate from messages where ForumID=$id and FID=$sfid and InReplyTo = $node order by Date desc" ); while($msgresult=mysql_fetch_array($msg)) { $MessageID=$msgresult['MessageID']; $InReplyTo=$msgresult['InReplyTo']; $PostedBy=$msgresult['PostedBy']; $Email=$msgresult['Email']; $Subject=$msgresult['Subject']; $Body=$msgresult['Body']; $Date=$msgresult['idate']; $edate=$msgresult['edate']; if ($ri % 2) { $color = '#FFFFEE'; } else { $color = '#CCCCBF'; } echo "$Subject"; echo "$PostedBy"; echo "$Date"; echo ""; // if($level==1){$ri=1;} // else{$ri=$ri;} showmsg($MessageID,$level+30); } } ?>