ASP anti-SQL injection source program _php Tutorial

Source: Internet
Author: User
Tags servervariables
This article provides a free ASP anti-SQL injection source program to see, the method is relatively simple to receive the value of query filter Oh.

This article provides a free ASP anti-SQL injection source program to see, the method is relatively simple to receive the value of query filter Oh.

<%
Squery=lcase (Request.ServerVariables ("query_string"))
Surl=lcase (Request.ServerVariables ("Http_host"))
Sql_injdata = ": |;|>|<|--|sp_|xp_| | dir|cmd|^| (|)| +|$|'| Copy|format|and|exec|insert|select|delete|update|count|*|chr|mid|master|truncate|char|declare "
Sql_inj = Split (Sql_injdata, "|")
For Sql_data=0 to Ubound (Sql_inj)
If InStr (Squery&surl,sql_inj (Sql_data)) >0 Then
Response.Write "Your operation may be SQL injection behavior. "
Response.End
End If
Next
%>

I myself think there is the method of anti-SQL injection, that is, with the trim () function, remove all the querystring value of the space, because SQL execution must have a space oh, and if it is the ID type is determined whether the number is OK.

http://www.bkjia.com/PHPjc/629744.html www.bkjia.com true http://www.bkjia.com/PHPjc/629744.html techarticle This article provides a free ASP anti-SQL injection source program to see, the method is relatively simple to receive the value of query filter Oh. This article provides a free ASP anti-SQL injection source program to see, method than ...

  • 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.