Solved

CFIF Statement

Posted on 2004-10-12
3
574 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
  • 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSL sertificate 5 65
Question to locate the problem 18 109
Ways to assess https/ssl websites 3 97
Help with a redirect in web.config file 8 42
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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