การป้องกันเพิ่มข้อมูลที่มีคำหยาบ มีดังนี้ครับ   คือส่วนที่มีสีขาวน่ะครับ

<%
name=Request.Form("name")
email=Request.Form("email")
comment=replace(replace(replace(Request.Form("comment"),"<","&lt;"),">","&gt;"),chr(13),"<br>")
'เก็บข้อความที่ Post เข้าตัวแปร wording
wording=msn_comment
Set ObjRegEx = New RegExp
'เก็บคำหยาบไว้ใน array เลยครับ เผื่อมีเยอะ
badword=array("หี","ควย","เย็ด","ห่า","แดก","จัญไร","เหี้ย","แตด","ควาย","หมา","คิง","บ่า","อีั,")
point=0
'ใช้ For เพื่อวนเช็คคำหยาบทั้งหมด
For i=0 to UBound(badword)
ObjRegEx.pattern=badword(i) 'เอาคำหยาบที่อยู่ใน Array มาตรวจสอบ
Result=ObjRegEx.Test(wording)
If Result="True" Then
Point=Point+1'ถ้าเจอคำหยาบ เราก็บวกแต้ม
End If
Next
'ตรวจสอบจากค่า Point ครับ ว่า เจอคำหยาบรึเปล่า
If Point > 0 then
Response.Write("เจอคำหยาบครับ กรุณาสุภาพด้วย")
else

Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.MDB)};DBQ=" & Server.Mappath("ohlanladb.mdb")
Sql="Select * from ohlanla where name like '%"& name &"%' "
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
if not rs.eof then
response.write"<center> มี username นี้ในฐานข้อมูลแล้ว"
else
rs.Addnew
rs("name")=name
rs("email")=email
rs("comment")=comment
rs.Update
rs.close
conn.Close
end if

%>