Ensuring Proper Password Format





-6
Date Submitted Tue. Feb. 28th, 2006 9:30 AM
Revision 1 of 1
Syntax Master dannyboy
Tags ASP | VBSCRIPT
Comments 0 comments
If you're asking your users to submit a password of 6-12 characters, you want to make sure it is done properly and without any special characters which could compromise your system.

To do this, you would want to use regular expressions

NewPass = request("newpass")
Dim RegEx
Set RegEx = New regexp
RegEx.Pattern = "^[A-Za-z0-9]{6,12}$"
RegEx.Global = True
RegEx.IgnoreCase = True

if RegEx.Test(NewPass) = FALSE then response.redirect("error.asp")
Set RegEx = NOTHING
 

Comments

There are currently no comments for this snippet.

Voting