|
Newbie trying to figure out CFRETURN
|
web.de-@yahoo.com
|
Nov 22, 2006 13:19 PST
|
Hi all -
I'm brand new to Mach-ii, been handed the keys to a site already built
in it. I'm trying to add a password retrieval function and running into
problems. I have a cffunction in the application listener that queries
my user database to see if the email entered exists.
<cffunction name="CheckPassword" returntype="void" output="false" >
<cfargument name="event" type="MachII.framework.Event" required="yes"
displayname="Event" />
<cfquery name="CheckPassword" datasource="#variables.dsn#" >
SELECT password
FROM users
WHERE email = '#email#'
</cfquery>
<cfif CheckPassword.recordcount EQ 0>
<cfset hasAccount = 'You don't have an account'>
<cfelseif CheckPassword.recordcount GTE 2>
<cfset hasAccount = 'You have too many accounts'>
<cfelse>
<cfset hasAccount = 'here is your password: #CheckPassword.password#'>
</cfif>
</cffunction>
I've stripped this down to get to the point, but you get my gist. Can I
just add a CFRETURN to the bottom, right above the close of the function
tag?
<cfreturn hasAccount />
And if so, how do I actually call the result of this function after the
user has submitted so they can see their password (or lack thereof)?
Thanks for your time!
dR
|
|
 |
|