%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' *** Generate Random Password, Set To Session Var, and Redirect To Insert Page - UltraLogin_108 ' Do Not Cache Page Response.Expires=-1500 Response.CacheControl="no-cache" ' Random Password Generation Code 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 GenerateRandomPassword(nLength) Dim i, bMadeConsonant, p, nRnd Const strDoubleConsonants = "bdfglmnpst" Const strConsonants = "bcdfghklmnpqrstv" Const strVocal = "aeiou" GenerateRandomPassword = "" bMadeConsonant = False For i = 0 To nLength nRnd = Rnd If GenerateRandomPassword <> "" AND (bMadeConsonant <> True) AND (nRnd < 0.10) Then p = Mid(strDoubleConsonants, Int(Len(strDoubleConsonants) * Rnd + 1), 1) p = p & p i = i + 1 bMadeConsonant = True Else If (bMadeConsonant <> True) And (nRnd < 0.95) Then p = Mid(strConsonants, Int(Len(strConsonants) * Rnd + 1), 1) bMadeConsonant = True Else p = Mid(strVocal,Int(Len(strVocal) * Rnd + 1), 1) bMadeConsonant = False End If End If GenerateRandomPassword = GenerateRandomPassword & p Next If Len(GenerateRandomPassword) > nLength Then GenerateRandomPassword = Left(GenerateRandomPassword, nLength) End If End Function ' *** Retrieve IP Address Dim IP IP = Request.ServerVariables("REMOTE_ADDR") ' Use this to generate password Dim password StrRandomize CStr("IP") & CStr(Now) & CStr(Rnd) password = GenerateRandomPassword(8) ' Set password to a session variable Session("password") = password ' Redirect to another page Response.Redirect("trade.asp") %>