By randomly generating a password and then emailing the password to a registered user, you can confirm that the user's email is correctly filled in. Automatically generated passwords tend to be more secure, and you can filter out users who are not valid.
Save the following code as a random.asp file:
<%
Sub strrandomize (Strseed)
Dim I, Nseed
Nseed = CLng (0)
For i = 1 to Len (strseed)
Nseed = Nseed Xor (256 * ((I-1) Mod 4) * AscB (Mid (Strseed, I, 1)))
Next
Randomize Nseed
End Sub
Function Generatepassword (nlength)
Dim I, Bmadeconsonant, C, nrnd
Const strdoubleconsonants = "Bdfglmnpst"
Const strconsonants = "Bcdfghklmnpqrstv"
Const strvocal = "Aeiou"
Generatepassword = ""
Bmadeconsonant = False
For i = 0 to Nlength
Nrnd = Rnd
If Generatepassword <> "" and (Bmadeconsonant <> True) and (Nrnd < 0.15) Then
c = Mid (Strdoubleconsonants, Int (Len (strdoubleconsonants) * Rnd + 1), 1)
c = C & C
i = i + 1
Bmadeconsonant = True
Else
If (bmadeconsonant <> True) and (Nrnd < 0.95) Then
c = Mid (Strconsonants, Int (Len (strconsonants) * Rnd + 1), 1)
Bmadeconsonant = True
Else
c = Mid (Strvocal,int (Len (strvocal) * Rnd + 1), 1)
Bmadeconsonant = False
End If
End If
Generatepassword = Generatepassword & C
Next
If Len (Generatepassword) > Nlength Then
Generatepassword = Left (Generatepassword, nlength)
End If
End Function
%>
You can then invoke the above code in your target program to automate the password generation: (Just an example, you can paste them into a test.asp file and run test.asp)
<!--include file= "random.asp"-->
<%
' Generates a six-bit password
Strrandomize CStr (now) & CStr (RND)
Response.Write Generatepassword (6)
%>
<br><br>
<%
' Generates a 8-bit password
Although this may have some trouble, but relative to the safety of the site and other factors, it is worthwhile, see how you choose.