<table width="310" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="top"> <table width="543" border="0"> <tr> <th align="right" scope="col"><img src="images/WebBroad.png" width="543" height="31" /> <table width="543" border="0"> <tr> <td align="left" scope="col"><form id="form1" name="form1" method="post" action="searchweb.php"> ค้นหา : <label for="textfield3"></label> <input type="text" name="search" id="textfield3" /> <img src="images/20130301093918417_easyicon_cn_32 (1).png" width="15" height="15" /> </form></td> <td align="right" scope="col"> <a href="NewQuestion.php"><img src="images/add.png" alt="" width="20" height="20" /><font color="#FF0000"> [ ตั้งกระทู้ ]</font></a></td> </tr> </table> <? //$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database"); //$objDB = mysql_select_db("meafahlung"); $strSQL = "SELECT * FROM webboard where status=1 "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); mysql_query("SET NAMES UTF8;"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by QuestionID DESC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?><br /> </th> </tr> </table></td> </tr> <tr> <td height="265" valign="top"><table width="543" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <th width="125" bgcolor="#CCCCCC" style="width: 110px; font-size: 15px;font-family: Arial;"> <div align="center"> หัวข้อกระทู้ </div></th> <th width="139" bgcolor="#CCCCCC" style="width: 110px; font-size: 15px;font-family: Arial;"> <div align="center"> ผู้ตั้งกระทู้ </div></th> <th width="155" bgcolor="#CCCCCC" style="width: 110px; font-size: 15px;font-family: Arial;"> <div align="center"> วันที่ </div></th> <th width="100" bgcolor="#CCCCCC" style="width: 100px; font-size: 15px;font-family: Arial;"> <div align="center"> อ่าน / ตอบ </div></th> </tr> <? $strNum = 0; while($objResult = mysql_fetch_array($objQuery)) { $strNum++; ?> <tr <? if($strNum%2==0){?>bgcolor="#EEE9E9"<? }//กำหนด $strNumเริ่มต้นที่ 0 //$strNum++; ใส่หลัง { ของ while ให้มันรันเลข + 1 ทุกครั้ง //if($strNum%2==0)คือถ้าแถวไหนค่า$strNumหาร2แล้วลงตัวให้เปลี่ยนสี?>> <td style=" font-size: 13px;font-family: Arial;"><a href="ViewWebboard.php?QuestionID=<?=$objResult["QuestionID"];?>"><font color="#000099"> <?=$objResult["Question"];?> </font></a></td> <td style=" font-size: 13px;font-family: Arial;"><font color="#000099"><?=$objResult["Name"];?></font></td> <td style=" font-size: 13px;font-family: Arial;"><div align="center"><font color="#000099"><?=$objResult["CreateDate"];?></font></div></td> <td align="center" style=" font-size: 13px;font-family: Arial;"><font color="#000099"><?=$objResult["View"];?></font> /<font color="#000099"> <?=$objResult["Reply"];?></font></td> </tr> <tr <? if($strNum%2==0){?>bgcolor="#EEE9E9"<? }//กำหนด $strNumเริ่มต้นที่ 0 //$strNum++; ใส่หลัง { ของ while ให้มันรันเลข + 1 ทุกครั้ง //if($strNum%2==0)คือถ้าแถวไหนค่า$strNumหาร2แล้วลงตัวให้เปลี่ยนสี?>> <td style=" font-size: 13px;font-family: Arial;"> </td> <td colspan="2" style=" font-size: 13px;font-family: Arial;">ทั้งหมด : <span class="listmenu1"> <?= $Num_Rows;?> แสดงข้อมูล : <?=$Num_Pages;?>จำนวนหน้า : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } mysql_close($objConnect); ?> </span></td> <td align="center" style=" font-size: 13px;font-family: Arial;"> </td> </tr> <? } ?> </table> <p> </p> <p> </p></td> </tr> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง