Login Server Behaviors Error

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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,...
    5. 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;
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139