Solved

CFIF Statement

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

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now