Re: query.recordcount woes...
It's because you have the CheckLogin.recordcount within the cfoutput q=CheckLogin tags, therefore if there are no row returned nothing with the cfoutput's will run ~ Justin Irish CF Head - Original Message - From: McDonald, David [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 05, 2000 2:14 PM Subject: query.recordcount woes... 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=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: query.recordcount woes...
If the recordcount of the query is 0, I don't think the code between the cfoutput-tags is processed. A better way to do it is: query name="checklogin" datasource="TheSource"TheQuery/query cfif NOT checklogin.recordcount cflocation url="login.cfm?task=loginfailure" cfelse cflocation url="Main.cfm?UserID=#checklogin.UserID#" /cfif rgds * Holger Lockertsen, Solutions Developer, Horisont Information Systems AS * Nedre Slottsgate 5, N-0157 OSLO, Noreg/Norway * 23 31 03 04 / 91 83 20 51 * [EMAIL PROTECTED] http://www.horisont.no/ NB! Horisont har fått nye nummer, og mitt INTERNNUMMER er: 23 31 03 04 -Original Message- From: McDonald, David [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 05, 2000 3:15 PM To: '[EMAIL PROTECTED]' Subject: query.recordcount woes... 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=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: query.recordcount woes...
If they leave it blank the query will return all rows (actually 1 since you have a maxrows =1) place your cfif Len(Username) AND Len(Password) cfquery/cfquery/cfif or someting like that...you should be able to figure it out now -Original Message- From: McDonald, David [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 05, 2000 9:15 AM To: '[EMAIL PROTECTED]' Subject: query.recordcount woes... 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=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.