Solved

CFIF Statement

Posted on 2004-10-12
3
582 Views
Last Modified: 2013-12-24
Hey all,

I'm using a form to retrieve users passwords when they have forgotten or lost them.  I need the code on the emailing action page to look at the email address that is on form, and then decide if that email address matches the one in the database.  If it does match, the page will send an email to the users inbox with their password.  If the email on the form that the user submits is not in the database, the user will be directed to the registration page.  

I need someone to please correct my logic on the action page...the error is in the <CFIF> statement.

Thanks,
Chris

*****************************CODE**********************************
<CFQUERY name="getpassword" datasource="TheConnection">
SELECT FirstName, Email, Password
FROM tblLoginE
WHERE '#FORM.Email#' = Email
</CFQUERY>
<cfset FirstName = getpassword.FirstName />
<cfset Password = getpassword.Password />

<cfif "FORM.Email" EQ "Email">

<CFMAIL TO="#FORM.email#"  FROM="cdoran@acedoran.com" SUBJECT="AceDoran.com Password">
-----------------------------------------------------------------------
               *** Ace Doran Website Password***
-----------------------------------------------------------------------
Hello #FirstName#,

Thanks for using www.acedoran.com.  Your information is as follows.  
   
   Username: #FORM.email#        
   Password: #Password#
   
   


Please go back to www.acedoran.com and login with this information.


Thanks,
Ace Doran IT Team!    

</CFMAIL>
<script language="Javascript">
      self.location = 'thanks.cfm?ID=5&message=PasswordReturned';
      </script>
<cfelse>
<cflocation url="http://www.acedoran.com/realtime/post.cfm?ID=15&cat=realtime">
</cfif>





0
Comment
Question by:inverted_2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
Renante Entera earned 500 total points
ID: 12293884
Hello inverted_2000!

You should have your code like this :

<CFQUERY name="getpassword" datasource="TheConnection">
SELECT FirstName, Email, Password
FROM tblLoginE
WHERE Email = '#FORM.Email#'
</CFQUERY>

<cfif getpassword.recordcount>

<cfset FirstName = getpassword.FirstName />
<cfset Password = getpassword.Password />

<CFMAIL TO="#FORM.email#"  FROM="cdoran@acedoran.com" SUBJECT="AceDoran.com Password">
-----------------------------------------------------------------------
               *** Ace Doran Website Password***
-----------------------------------------------------------------------
Hello #FirstName#,

Thanks for using www.acedoran.com.  Your information is as follows.  
   
   Username: #FORM.email#        
   Password: #Password#
   
   


Please go back to www.acedoran.com and login with this information.


Thanks,
Ace Doran IT Team!    

</CFMAIL>
<script language="Javascript">
     self.location = 'thanks.cfm?ID=5&message=PasswordReturned';
     </script>
<cfelse>
  <cflocation url="http://www.acedoran.com/realtime/post.cfm?ID=15&cat=realtime">
</cfif>

Goodluck!
eNTRANCE2002 :-)
0
 
LVL 2

Author Comment

by:inverted_2000
ID: 12293976
You the man!!!

or lady....your alias is undetermining (o:

Thanks a lot regardless!!!

Chris
0
 
LVL 14

Expert Comment

by:Renante Entera
ID: 12294038
Oh! I'm glad that I have helped you.  

You can always expect some experts to help you and I'm one of the guys that will spend time on helping you.

Hope to help you again.


Regards!
eNTRANCE2002 :-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Internal DNS Zone Issue 13 92
Unsearchable in Google,Yahoo and Bing. 6 71
Link failure 16 93
Can we or good to install Ap Struts patches even if we don't run Ap Struts 7 84
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question