--- In [email protected], Mark E <[EMAIL PROTECTED]> wrote: > George, > > Can you post your code? > > Mark
Mark - Sure, the code is below: <% Option Explicit %> <!-- #Include file = "../../AccessConn.asp" --> <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Lost Password2</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="../../Main.css" /> </head> <body> <% Dim Username, Question, Answer Dim strSQL, objCommand, objRec Dim Ret Ret = OpenCommand(objCommand, "LAKS") Username = Request.Form("Username") Question = Request.Form("Question") Answer = Request.Form("Answer") If Username = "" Then Call GetUsername Else If Answer = "" Then Call GetQuestion Else Call ShowAnswer End If End If %> <div style='margin-top:20px;text-align:center;'><a href='JavaScript:window.close();'>Close Window</a></div> <% '----------------------------- Sub GetUsername %> <form name='form1' action='LostPassword.asp' method='post'> <label>Enter your Username:<br /> <input type='text' name='Username' /><br /><br /> <input type='submit' value='Submit Username' /> </form> <script language='JavaScript'>document.form1.Username.focus();</script> <% End Sub Sub GetQuestion strSQL = "Select [Question] From [Registration] Where [Username] = '" & Username & "'" strsql = "Select [Question] From [Registration] Where [Username] = 'z'" objCommand.CommandText = strSQL Set objRec = objCommand.Execute If objRec.EOF Then Response.Write "<div style='color:#F00'><strong>The Username you entered cannot be found in the database.</strong></div>" & _ "<br /><div>Press your Backspace key and reenter your Username.</div>" & _ "If you continue to have problems then contact Liquid Adventures.</div>" Else Question = objRec("Question") Select Case Question Case 1 Response.Write "<p>What is your mother's maiden name?</p>" Case 2 Response.Write "<p>What was your first pet's name?</p>" Case 3 Response.Write "<p>What city were you born?</p>" Case 4 Response.Write "<p>Answer your own question.</p>" End Select %> <form name='form1' action='LostPassword.asp' method='post'> <input type="hidden" name="Username" value="<%=Username%>" /> <label>Enter your Answer:<br /> <input type='text' name='Answer' /><br /><br /> <input type='submit' value='Submit Answer' /> </form> <p class="XXSmallInfo">With a correct answer your Password will be displayed.</p> <script language='JavaScript'>document.form1.Answer.focus();</script> <% End If End Sub Sub ShowAnswer strSQL = "Select Pwd From Registration Where Username = '" & Username & "' And Answer = '" & Answer & "'" objCommand.CommandText = strSQL Set objRec = objCommand.Execute If objRec.EOF Then Response.Write "<div style='color:#F00'><strong>The Answer you entered cannot be found in the database.</strong></div>" & _ "<br /><div>Press your Backspace key and reenter your Answer.</div>" & _ "If you continue to have problems then contact Liquid Adventures.</div>" Else Response.Write "Your Password is " & objRec("Pwd") End If End Sub %> </body> </html> Does that help? Cheers - george --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
