username validation

This is a discussion on "username validation" within the Classic ASP section. This forum, and the thread "username validation are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 9th, 2004, 01:53
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
username validation

I am using the Macromedia Ultradev 4 to create my ASP page..
In the software, there is a built in function that we can used to validate our form especially the "username validation"

here is the code...
Code: Select all
<%
' *** Redirect if username exists
MM_flag="MM_insert"
If (CStr(Request(MM_flag)) <> "") Then
  MM_dupKeyRedirect="admin/usernameAdminExist.asp"
  MM_rsKeyConnection=MM_AdminRegister_STRING
  MM_dupKeyUsernameValue = CStr(Request.Form("username"))
  MM_dupKeySQL="SELECT username FROM userlist WHERE username='" & MM_dupKeyUsernameValue & "'"
  MM_adodbRecordset="ADODB.Recordset"
  set MM_rsKey=Server.CreateObject(MM_adodbRecordset)
  MM_rsKey.ActiveConnection=MM_rsKeyConnection
  MM_rsKey.Source=MM_dupKeySQL
  MM_rsKey.CursorType=0
  MM_rsKey.CursorLocation=2
  MM_rsKey.LockType=3
  MM_rsKey.Open
  If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then 
    ' the username was found - can not add the requested username
    MM_qsChar = "?"
    If (InStr(1,MM_dupKeyRedirect,"?") >= 1) Then MM_qsChar = "&"
    MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
    Response.Redirect(MM_dupKeyRedirect)
  End If
  MM_rsKey.Close
End If
%>
this code will check a field in my form which is the "username" field and then redirect the page to another page if the username was found in my database..
Code: Select all
  MM_dupKeyRedirect="admin/usernameAdminExist.asp"
What I want to do is to modify this code so that it can check more that one parameter, in this case it is the username only! I want to check maybe the studentID field and the DOB field. This field is the primary key inside my database for example.

<span style="color:blue">Can anybody help me to modify this code...?</span id="blue">
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Closed Thread

Tags
username, validation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
validating username sudhakararaog PHP Forum 1 May 26th, 2008 21:29
input $_SESSION['username'] = $username; on login page help Aaron1988 PHP Forum 2 Jan 28th, 2008 14:14
[SOLVED] PHP welcome username help. Aaron1988 PHP Forum 18 Nov 16th, 2007 17:19
[SOLVED] ASP-MySQL Username Validation Monie Classic ASP 2 Oct 22nd, 2007 06:06


All times are GMT. The time now is 05:03.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43