วิธีป้องกันต่างชาติสแปม เว็บบอร์ด SMF

Google tool Add comments
ใช้เทคนิคเดิม คือ  ตรวจดูว่าข้อความที่โพส มีภาษาไทยอยู่ด้วยหรือเปล่า   ถ้าไม่ใช่ก็ไม่ให้ผ่าน
เหมาะสำหรับคนที่มีเว็บบอร์ด SMF แบบไม่ต้องสมัครสมาชิกก็โพสได้ หรือแบบต้องสมัครสมาชิกก่อนถึงจะโพสได้ (เพราะบางทีแสปมต่างชาติมันก็สมัครมาโพสป่วนบอร์ดได้เหมือนกัน)

นำโค้ดด้านล่างไปใส่ในไฟล์  Sources/Post.php  แล้วเซฟเป็น UTF-8 อัพโหลดไปทับของเดิมบนโฮส

**อยู่ประมาณ บรรทัดที่ 1282  (ใต้บรรทัด // Check the subject and message.)

อ้างถึง
   if(!preg_replace(’/[^ก-ฮ]/u’,”,$_POST['subject'])){
  $post_errors[] = ‘no_subject’;
   }

   if(!preg_replace(’/[^ก-ฮ]/u’,”,$_POST['message'])){
  $post_errors[] = ‘no_subject’;
   }

 

ย้ำนะครับว่าต้อง เซฟเป็น UTF-8 อัพโหลดไปทับของเดิมบนโฮส  

แล้วสังเกตุดูที่ตัว ก กับ ฮ  จะกายป็นตัวแปลกๆ

ที่มา    http://www.thaiseoboard.com/index.php/topic,77219.0.html

Leave a Reply


| bathing equipment | jewelry | Apple iPod touch | t-mobile g1 | computer asseccery | book computer | office tool | led hdtv | LG bluray | watch | twilight | netbook | Samsung LN46B750 | levi's 501 | Swissgear backpack | citizen eco-drive | bathing equipment | Acer AO532 | Backpack Computer | Blender Low Price | Cheap all Product | Cheap all Watches | Cheap Buy iphone 4G | Cheap Buy Plasma HDTV | Cheap in UK | Cheap to Buy all Product | Cheap to Buy all Watches | Cheap to Buy Book Store | Cheap to Buy HDTV | Compare Netbook | Digital SLR | HDTV | Health Shop | Home Love Garden | i Love Pet Shop | Kitchens Shop | Low Price Diapers | Netbook | Power Tools | Rate Shipping | iphone Rate all Shipping | Tip to Make Monet Online

Valid CSS!

Hotels2thailand.com
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in