Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CFIF Statement

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

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

730 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