Vbsrcipt code for Anti-SQL injection _vbs

Source: Internet
Author: User
Tags sql injection
<script language= "VBScript" >
function Checkstr (strname)
Strn=trim (Strname.value)
Str=trim (Strname.value)
For I=1 to Len (str)
STRCHECK=ASC (Left (str,1))
If not (strcheck=<122 and strcheck>=97) or (strcheck<=90 and strcheck>=65) or (strcheck<=57 and STRCHECK&G t;=48)) Then
MsgBox ("Do not use characters except English letters and numbers!") ")
Strname.value = Left (strn,i-1)
Strname.focus
Exit For
End If
Str=right (Str,len (str)-1)
Next
End Function
function Checknum ()
Checknum=true
If not document.all.txtmailsize.value= "" Then
If not IsNumeric (Document.all.txtMailSize.value) Then
MsgBox ("Do not use characters other than numbers!") ")
Document.all.txtmailsize.value= ""
Document.all.txtMailSize.focus
Checknum=false
else if document.all.txtmailsize.value>5 or document.all.txtmailsize.value<0 then
MsgBox ("Please fill in the number between 5-0!") ")
Document.all.txtmailsize.value= ""
Document.all.txtMailSize.focus
Checknum=false
End If
End If
End If
End Function

function Checkupdate ()
Checkupdate=true
If document.all.txtu_name.value= "" or document.all.txtmailsize.value= "" Then
MsgBox ("You fill in the information is not complete!") ")
Checkupdate=false
End If
End Function
function Compare ()
Compare=true
If not document.all.txtRePsw.value =document.all.txtpsw.value then
MsgBox ("Two times password input inconsistent!") ")
Document.all.txtRePsw.focus
Compare=false
End If
End Function

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.