Asp anti-SQL injection source code _ PHP Tutorial

Source: Internet
Author: User
Tags servervariables
Asp anti-SQL injection source program. This article provides an asp anti-SQL injection source program for free. the simple method is to receive query values for filtering. This article provides an asp anti-SQL injection source program free of charge, the method is more simple than this article provides an asp anti-SQL injection source program, the method is relatively simple is to receive the query value for filtering.

This article provides an asp anti-SQL injection source program for free. the simple method is to receive query values for filtering.

<%
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 operations may be SQL injection. "
Response. end
End if
Next
%>

I think there is also a way to prevent SQL injection, that is, to use the trim () function to remove spaces of all values from querystring, because SQL execution must contain spaces, in addition, if the id type is used, it is OK to determine whether it is a number.

Bytes. This article provides an asp anti-SQL injection source program free of charge, the method ratio...

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.