<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td rowspan="2"><img src="images/home_01.gif" width="924" height="307" /></td> <td><img src="images/home_02.gif" width="213" height="74" /></td> <td><img src="images/home_03.gif" width="213" height="74" /></td> </tr> <tr> <td colspan="2"><img src="images/home_04.gif" width="426" height="233" /></td> </tr> </table> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/home_05.gif" width="256" height="59" /></td> <td><img src="images/home_06.gif" width="291" height="59" /></td> <td><img src="images/home_07.gif" width="292" height="59" /></td> <td><img src="images/home_08.gif" width="270" height="59" /></td> <td><img src="images/home_09.gif" width="241" height="59" /></td> </tr> <tr> <td colspan="5"><p><img src="images/home_10.gif" width="1350" height="28" /></p> <div align="center"> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td><? $objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database"); $objDB = mysql_select_db("map"); if($_GET["Action"] == "Save") { //*** Insert Reply ***// $strSQL = "INSERT INTO reply "; $strSQL .="(QuestionID,CreateDate,Details,Name) "; $strSQL .="VALUES "; $strSQL .="('".$_GET["QuestionID"]."','".date("Y-m-d H:i:s")."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') "; $objQuery = mysql_query($strSQL); //*** Update Reply ***// $strSQL = "UPDATE webboard "; $strSQL .="SET Reply = Reply + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL); } ?> </td> </tr> </table> <? //*** Select Question ***// $strSQL = "SELECT * FROM webboard WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); //*** Update View ***// $strSQL = "UPDATE webboard "; $strSQL .="SET View = View + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL); ?> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td colspan="2"><center> <h1> <?=$objResult["Question"];?> </h1> </center></td> </tr> <tr> <td height="53" colspan="2"><?=nl2br($objResult["Details"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult["Name"];?> Create Date : <?=$objResult["CreateDate"];?></td> <td width="253">View : <?=$objResult["View"];?> Reply : <?=$objResult["Reply"];?></td> </tr> </table> <br /> <br /> <? $intRows = 0; $strSQL2 = "SELECT * FROM reply WHERE QuestionID = '".$_GET["QuestionID"]."' "; $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["Details"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult2["Name"];?> </td> <td width="253">Create Date : <?=$objResult2["CreateDate"];?></td> </tr> </table> <br /> <? } ?> <br /> <a href="Webboard.php">Back to Webboard</a> <br /> <br /> </div> <form action="ViewWebboard.php?QuestionID=<?=$_GET["QuestionID"];?>&Action=Save" method="post" name="frmMain" id="frmMain2"> <div align="center"> <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> <tr> <td width="78">Name</td> <td width="647"><input name="txtName" type="text" id="txtName" value="" size="50" /></td> </tr> </table> <input name="btnSave" type="submit" id="btnSave" value="Submit" /> </div> </form></td> </tr> </table> <tr> <td> </body> </html> <? mysql_close($objConnect); ?> </td> </tr> </table> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/home_12.jpg" width="1350" height="112" /></td> </tr> </table> <p> </p> <p> </p> </body> </html>
$objQuery = mysql_query($strSQL) or die(mysql_error());
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง