Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
FusionRed #1
Login Server Behaviors Error
This is my first experience using the Server Behaviors for login pages, and I
get the following error from the Wizard.'s code:
Error Occurred While Processing Request
Context validation error for tag cfelse.
The tag must be nested inside a CFIF tag.
The error occurred in C:\CFusionMX\wwwroot\PCNData\Application.cfm: line 27
25 : <cfinclude templage="loginform.cfm">
26 : <cfabort>
27 : <cfelse>
28 : <cfquery name="loginQuery" dataSource="PCN">
29 : SELECT UserID, Roles
The entire piece of code placed into my page by the wizard is:
<cfif IsDefined("FORM.txtUserName")>
<cfset MM_redirectLoginSuccess="frmPCNUserMenu.cfm">
<cfset MM_redirectLoginFailed="frmPCNBadLogin.cfm">
<cfquery name="MM_rsUser" datasource="pcn">
SELECT login,password,Role FROM UserID WHERE login='#FORM.txtUserName#' AND
password='#FORM.txtPassword#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.txtUserName>
<cfset Session.MM_UserAuthorization=MM_rsUser.Role[1]>
</cflock>
<cfif IsDefined("URL.accessdenied") AND true>
<cfset MM_redirectLoginSuccess=URL.accessdenied>
</cfif>
<cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
<cfcatch type="Lock">
<!--- code for handling timeout of cflock --->
</cfcatch>
</cftry>
</cfif>
<cflocation url="#MM_redirectLoginFailed#" addtoken="no">
<cfelse>
<cfset MM_LoginAction=CGI.SCRIPT_NAME>
<cfif CGI.QUERY_STRING NEQ "">
<cfset MM_LoginAction=MM_LoginAction & "?" & CGI.QUERY_STRING>
</cfif>
</cfif>
It appears that there should be another <cfif> clause in this code; however,
I'm unsure where to put it. Can anyone help with this???? I've tried password
protecting other pages and I get exactly the same error every time. I was
running CF6.0 and have since upgraded to CF7.0 in the hope that would solve the
problem; however, the same problem persists.
Thank you in advance for your expertise and time.
Red;->
FusionRed Guest
-
Server behaviors which require other server behaviors
I have a server behavior which initializes my CMS, and it is required by all the other server behaviors I've created for the CMS. I can use... -
Server Behaviors (Newbie questions)
Hi all, I'm new to Dreamweaver and am trying to get a basic site set up. I have a Linux account with MySql at Godaddy.com for the server, and... -
Server Behaviors
I'm trying to create a dynamic drop down menu. I've been going through a tutorial but my trouble began when I was instructed to create a show-hide... -
Using Server Behaviors without Testing Server
Because of the way my company sets up ColdFusion I dont' have a testing server and thus can't use the database connection tool, server behavior,... -
PHP and Server Behaviors
I would like to know if anyone can direct me to information on how to use server behaviors in DreamWeaver MX 2004 :beer; -
FusionRed #2
Re: Login Server Behaviors Error
Sorry to have troubled anyone. When I put this on the web site it runs, it just won't test from the desktop.
Red;->
FusionRed Guest



Reply With Quote

