<? include "connect.php"; if($_GET["Action"] == "Save") { //*** Insert Reply ***// $strSQL = "INSERT INTO tb_comment "; $strSQL .="(comment_ptid, comment_detail, comment_date, comment_mid) "; $strSQL .="VALUES "; $strSQL .="('".$_GET["post_id"]."', '".$_POST["txtDetails"]."', '".date("Y-m-d H:i:s")."', '6') "; $objQuery = mysql_query($strSQL); //*** Update Reply ***// $strSQL = "UPDATE tb_post "; $strSQL .="SET tb_comment = tb_comment + 1 WHERE post_id = '".$_GET["post_id"]."' "; $objQuery = mysql_query($strSQL); } ?> <? //*** Select Question ***// $strSQL = "SELECT * FROM tb_post WHERE post_id = '".$_GET["post_id"]."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); //*** Update View ***// $strSQL = "UPDATE tb_post SET view = view + 1 WHERE post_id = '".$_GET["post_id"]."' "; $objQuery = mysql_query($strSQL); echo $strSQL; ?> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td colspan="2"><center><h1><?=$objResult["post_title"];?></h1></center></td> </tr> <tr> <td height="53" colspan="2"><?=nl2br($objResult["post_detail"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult["tb_mid"];?> Create Date : <?=$objResult["tb_cdate"];?></td> <td width="253">View : <?=$objResult["view"];?> Reply : <?=$objResult["reply"];?></td> </tr> </table> <br> <br> <? $intRows = 0; $strSQL2 = "SELECT * FROM tb_comment WHERE post_id = '".$_GET["post_id"]."' "; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL."]"); while($objResult2 = mysql_fetch_array($objQuery2)) { $intRows++; ?> No : <?=$intRows;?> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td height="53" colspan="2"><?=nl2br($objResult2["comment_detail"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult2["comment_mid"];?></td> <td width="253">Create Date : <?=$objResult2["comment_date"];?></td> </tr> </table><br> <? } ?> <br> <a href="review.php">Back to Webboard</a> <br> <br> <form action="viewreview.php?post_id=<?=$_GET["post_id"];?>&Action=Save" method="post" name="frmMain" id="frmMain"> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td width="78">Details</td> <td><textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea></td> </tr> </table> <input name="btnSave" type="submit" id="btnSave" value="Submit"> <? mysql_close($objConnect); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง