I have been trying to set up a username and password login, which is
working okay, except for the "failed login" scenario. The <cfif> tag does
not
execute the <cflocation> tag for a failed login (ie. query.recordcount is
0). I'm lost as to why. Here's my code (called from a previous template
form supplying the username and password variables):
<cfquery datasource="fln" name="CheckLogin">
SELECT UserID, Username, Password, FirstName, LastName
FROM User
WHERE (
<cfif Username is not "">Username='#Username#'</cfif> AND
<cfif Password is not "">Password='#Password#')</cfif>
</cfquery>
<cfoutput query="CheckLogin" maxrows=1>
<cfif CheckLogin.recordcount is 0>
<cflocation url="login.cfm?task=loginfailure">
<cfelse>
<cflocation url="Main.cfm?UserID=#UserID#">
</cfif>
</cfoutput>
If the recordcount is not equal to 0 (successful login), it works
beautifully, but if the recordcount is 0 (failed login), the
<cflocation url="login.cfm?task=loginfailure"> code does not execute, it
simply returns a blank page (with the cf server info displayed).
Anyone help me with this? It seems very straightforward but has me stumped.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.