Prevent others from adding delete or other characters to the QueryString to delete your database contents

Source: Internet
Author: User
Tags error handling
Now some people on the network have to use Programmer's SQL Programming Vulnerability (estimated and called vulnerability: P)
After QueryString, add a statement such as:;d elete forum_forum;--, to delete your database.
The reason for this is that programming is not tight. I give you a small way, perhaps this method is too vegetable, but please do not be laughed at. :)
Examle:
<a href= "Add.asp?action=add" >
<a href= "Add.asp?action=delete" >
The handler functions are as follows:
Action1=trim (Request.QueryString ())
If left (action1,7) <> "action=" Then ' qualify querystring must be action=
Error (ERR01) ' Fault handling
Else
Action=request.querystring ("action") ' Gets the value of querystring
End If
Select Case Action ' handles the QueryString
Case "Add"
.....
Case "Delete"
......
Case Else ' If QueryString does not have this value then error handling
Error (ERR02)
End Select

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.