Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFIF Statement

Posted on 2004-10-12
3
Medium Priority
?
618 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 2000 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview

885 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