Click to See Complete Forum and Search --> : Radom Display number


xesojay
12-06-2005, 04:00 AM
Hi Guys,
Please am trying to achieve a verification code, where some number will be display and the user will be ask to enter the displayed number inside a textbox for verification. I know that the number or letter are randomly display but I have no ideal on how to achieve this. Please kindly help me out. Thanks for your help.

Bullschmidt
12-06-2005, 07:37 AM
You may want to do some searching at the following:

HotScripts.com
http://www.hotscripts.com

Planet Source Code
http://www.planet-source-code.com

Scripts.com
http://www.scripts.com

The ASP Resource Index
http://www.aspin.com

Ubik
12-06-2005, 09:16 AM
I have no idea where I picked this up from:

'digits: rKey number of characters long
'LC: 0-do not allow LowerCase keys, 1-allow lower case keys.



Function rKeyGen(Digits, LC)
Dim i, j, UB
Dim Temp
Dim Poss(62) ' This is our array of possible characters
j = 0
For i = 48 To 57
Poss(j) = Chr(i)
j = j + 1
Next
For i = 65 To 90
Poss(j) = Chr(i)
j = j + 1
Next
For i = 97 To 122
Poss(j) = Chr(i)
j = j + 1
Next
Temp = ""
If LC = True Then UB = 61 Else UB = 35
For i = 1 To Digits
Randomize
Temp = Temp & Poss(Int((UB - 0 + 1) * Rnd + 0))
Next
rKeyGen = Temp
End Function

russell_g_1
12-10-2005, 08:36 AM
nice function there