Hi,
Can anyone Help??
I am trying to create a login procedure. The first page asks for a username and password and the correct password reminder answer is displayed (on the action page1).
The action page "1" then displays the password reminder question and asks for the answer in a Form.
The problem lies in the second action page..It half works!
- When the correct answer is entered it displays the password..cool!
- when an incorrect answer is entered a validated error message is displayed...cool!
The problem:
1) When I enter another users password (user B) reminder answer, it displays displays user b's answer when it should display my validated error?
2) two different users with the same password reminder question and answer are displayed (The users Uniqueness is not observed)
Can any one please help.
I am attaching the code as a reference
Thank
Sam
Actiopage1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- This is the origina password reminder where I attempted to rtrieve the users password reminder question and submit
The answer to another form. Instead I opted to just the question which the user should be able to answer at the login screen-->
<HTML>
<HEAD>
<TITLE>Retrieve Member login details</TITLE>
</HEAD>
<BODY>
<CFQUERY DATASOURCE= "ONLINE" NAME="Retrieve_Question">
SELECT Username, Email, PasswordReminderQuestion,PasswordReminderAnswer, Surname
FROM Users
WHERE UserName = '#Form.UserName#' AND SurName= '#form.SurName#'
</CFQUERY>
<CFIF #Retrieve_Question.RecordCount# IS "0">
<CFOUTPUT>
Im Sorry, the name <B>#UserName#</B> and Last Name <B>#SurName#</B> that you entered does not match a valid user.<BR>
You need to either <A href="NewUser.cfm"> create an account </A> or
<A href="ForgottenPassword.cfm"> Try again</A>
</CFOUTPUT>
<CFELSE>
<CFOUTPUT QUERY="retrieve_question">
<CFFORM ACTION = "PasswordAns.cfm" METHOD ="POST">
<INPUT TYPE="hidden" NAME="UserName" VALUE="#FORM.UserName#">
<INPUT TYPE="hidden" NAME="SurName" VALUE="#FORM.SurName#">
Your User Name is #UserName#<BR>
Your Last Name is #SurName#<BR>
Your Password Reminder Question is #PasswordReminderQuestion#<BR>
Please Enter your answer to the question:
<CFINPUT MESSAGE="You must enter your answer" REQUIRED = "Yes" TYPE="Text" NAME="PasswordReminderAnswer">
<INPUT TYPE="submit" VALUE="process">
<INPUT TYPE="reset" VALUE="Clear"><BR>
</CFFORM>
</CFOUTPUT>
</CFIF>
</BODY>
</HTML>
Actionpage2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Retrieve Password</TITLE>
</HEAD>
<BODY>
<CFQUERY DATASOURCE= "ONLINE" NAME="Retrieve_Password">
SELECT UserName, Password, Email, PasswordReminderQuestion, PasswordReminderAnswer, Surname
FROM Users
WHERE PasswordReminderAnswer = '#form.PasswordReminderAnswer#'
</CFQUERY>
<CFIF #Retrieve_Password.recordcount# is 0 >
<CFOUTPUT>
Im Sorry, the answer <B>#PasswordReminderAnswer#</B> to your question is invalid.<BR>
#username#, #surname#
You need to either <A HREF="NewUser.cfm"> create an account </A> or
<A HREF="ForgottenPassword.cfm"> Try again</a>
</CFOUTPUT>
<CFELSE>
<CFOUTPUT QUERY = "Retrieve_Password">
You may now log in with the following details:<BR>
User Name : <B>#UserName#</B>
Password : <B>#Password#</B><BR><BR>
</CFOUTPUT>
</CFIF>
</BODY>
</HTML>
Can anyone Help??
I am trying to create a login procedure. The first page asks for a username and password and the correct password reminder answer is displayed (on the action page1).
The action page "1" then displays the password reminder question and asks for the answer in a Form.
The problem lies in the second action page..It half works!
- When the correct answer is entered it displays the password..cool!
- when an incorrect answer is entered a validated error message is displayed...cool!
The problem:
1) When I enter another users password (user B) reminder answer, it displays displays user b's answer when it should display my validated error?
2) two different users with the same password reminder question and answer are displayed (The users Uniqueness is not observed)
Can any one please help.
I am attaching the code as a reference
Thank
Sam
Actiopage1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- This is the origina password reminder where I attempted to rtrieve the users password reminder question and submit
The answer to another form. Instead I opted to just the question which the user should be able to answer at the login screen-->
<HTML>
<HEAD>
<TITLE>Retrieve Member login details</TITLE>
</HEAD>
<BODY>
<CFQUERY DATASOURCE= "ONLINE" NAME="Retrieve_Question">
SELECT Username, Email, PasswordReminderQuestion,PasswordReminderAnswer, Surname
FROM Users
WHERE UserName = '#Form.UserName#' AND SurName= '#form.SurName#'
</CFQUERY>
<CFIF #Retrieve_Question.RecordCount# IS "0">
<CFOUTPUT>
Im Sorry, the name <B>#UserName#</B> and Last Name <B>#SurName#</B> that you entered does not match a valid user.<BR>
You need to either <A href="NewUser.cfm"> create an account </A> or
<A href="ForgottenPassword.cfm"> Try again</A>
</CFOUTPUT>
<CFELSE>
<CFOUTPUT QUERY="retrieve_question">
<CFFORM ACTION = "PasswordAns.cfm" METHOD ="POST">
<INPUT TYPE="hidden" NAME="UserName" VALUE="#FORM.UserName#">
<INPUT TYPE="hidden" NAME="SurName" VALUE="#FORM.SurName#">
Your User Name is #UserName#<BR>
Your Last Name is #SurName#<BR>
Your Password Reminder Question is #PasswordReminderQuestion#<BR>
Please Enter your answer to the question:
<CFINPUT MESSAGE="You must enter your answer" REQUIRED = "Yes" TYPE="Text" NAME="PasswordReminderAnswer">
<INPUT TYPE="submit" VALUE="process">
<INPUT TYPE="reset" VALUE="Clear"><BR>
</CFFORM>
</CFOUTPUT>
</CFIF>
</BODY>
</HTML>
Actionpage2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Retrieve Password</TITLE>
</HEAD>
<BODY>
<CFQUERY DATASOURCE= "ONLINE" NAME="Retrieve_Password">
SELECT UserName, Password, Email, PasswordReminderQuestion, PasswordReminderAnswer, Surname
FROM Users
WHERE PasswordReminderAnswer = '#form.PasswordReminderAnswer#'
</CFQUERY>
<CFIF #Retrieve_Password.recordcount# is 0 >
<CFOUTPUT>
Im Sorry, the answer <B>#PasswordReminderAnswer#</B> to your question is invalid.<BR>
#username#, #surname#
You need to either <A HREF="NewUser.cfm"> create an account </A> or
<A HREF="ForgottenPassword.cfm"> Try again</a>
</CFOUTPUT>
<CFELSE>
<CFOUTPUT QUERY = "Retrieve_Password">
You may now log in with the following details:<BR>
User Name : <B>#UserName#</B>
Password : <B>#Password#</B><BR><BR>
</CFOUTPUT>
</CFIF>
</BODY>
</HTML>