SQL anti-injection

Source: Internet
Author: User

SQL anti-injection SQL generic anti-injection system SQL anti -injection code SQL generic anti-injection SQL Universal Anti-Injection program ASP SQL anti-injection SQL anti-injection system SQL anti-injection program SQL Inbound download ASP SQL anti-injection code
'///////////////////////////////////
' SQL filter
'--------Definition part------------------
Dim Fy_post,fy_get,fy_in,fy_inf,fy_xh,fy_db,fy_dbstr
' Customize the string to be filtered, separated by ' | '
fy_in = "' |and|exec|insert|select|delete|update|count|*|%| Chr|mid|master|truncate|char|script|declare "
'----------------------------------

Fy_inf = Split (fy_in, "|")
'--------Post part------------------
If chulizhuru= "" Then
If request.form<> "" Then
For each fy_post in Request.Form

For fy_xh=0 to Ubound (Fy_inf)
If Instr (LCase (Request.Form (Fy_post)), Fy_inf (FY_XH)) <>0 Then
Call Cnerror ("do not include \ n \ nthe information you entered" &replace (Server.HTMLEncode (Fy_inf (FY_XH)), "'", "" ") &" \ n \ nplease return check please cancel this content ", 0
End If
Next

Next
End If
End If


'----------------------------------

'--------Get part-------------------
If request.querystring<> "" Then
For each fy_get in Request.QueryString

For fy_xh=0 to Ubound (Fy_inf)
If Instr (LCase (Request.QueryString (Fy_get)), Fy_inf (FY_XH)) <>0 Then
Call Cnerror ("do not include \ n \ nthe information you entered" &replace (Server.HTMLEncode (Fy_inf (FY_XH)), "'", "'") & "\n\; please return to check please cancel this content", 0)
End If
Next
Next
End If

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.