logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Painting
Heart Disease
Horror Literature
Dating
Hiking & Backpacking
SF/Fantasy Books
Healthy Foods


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g ASP Site

BellaOnline's ASP Editor

g

Ensuring Proper Password Format

Guest Author - Lisa Shea

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. Be sure to read the articles on this site that explain how regular expressions work if you have not used them before.

The code would look like this:

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

That ensures that the user-submitted password is 6-12 characters long and is made up solely of letters and numbers - no special characters like ; or ' that might jeopardize your database security.

Note that you need the ^ at the beginning and $ at the end. That ensures that the entire pattern matches - from the very beginning to the very end of the string.

Be sure to use input checks not only on your passwords, but on anything the user submits that then gets sent along to a database query!
This site needs an editor - click to learn more!

Add Ensuring+Proper+Password+Format to Twitter Add Ensuring+Proper+Password+Format to Facebook Add Ensuring+Proper+Password+Format to MySpace Add Ensuring+Proper+Password+Format to Del.icio.us Digg Ensuring+Proper+Password+Format Add Ensuring+Proper+Password+Format to Yahoo My Web Add Ensuring+Proper+Password+Format to Google Bookmarks Add Ensuring+Proper+Password+Format to Stumbleupon Add Ensuring+Proper+Password+Format to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2013 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
Best uses for RSS

RSS and its future.

Force Download Dialog box with ASP

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2013 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor