Problem with <cfif> tag
Basically, I'm trying to add some text to my header depending on whether or not the user is logged in. If they are, it will display one thing (Welcome, My Account, Logout), if they are not, it will display something else (Login/Register). I'm using Dreamweaver which I know can do some silly things with code, but being a CF and web design novice, the only way I could think of to do this is with a <cfif> tag. Here is what I've come up with, but I keep getting errors and I cannot figure out why. The first chunk of code is for the logout query, the second is a recordset to grab the first name of the current user, if they are logged in. Those appear to be working okay, the issues seem to be coming from the <cfif> tag in the <body>. The error I'm getting says I need a closing </cfif> tag, but it looks to me like it should be okay. Any thoughts on what I screwed up?
Thanks for any help you can give!
Jeremy
<cfif IsDefined("URL.MM_logout") AND URL.MM_logout EQ "1">
<cflock scope="Session" type="Exclusive" timeout="30" throwontimeout="no">
<cfset Session.MM_Username="">
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfset MM_logoutRedirectPage="../index.cfm">
<cfif MM_logoutRedirectPage EQ "">
<cfset MM_logoutRedirectPage=CGI.SCRIPT_NAME>
</cfif>
<cfset MM_logoutQuery=ListDeleteAt(CGI.QUERY_STRING,ListContainsNoCase(CGI.QUERY_STRING,"MM_logout=","&"),"&")>
<cfif MM_logoutQuery NEQ "">
<cfif Find("?",MM_logoutRedirectPage) EQ 0>
<cfset MM_logoutRedirectPage=MM_logoutRedirectPage & "?" & MM_logoutQuery>
<cfelse>
<cfset MM_logoutRedirectPage=MM_logoutRedirectPage & "&" & MM_logoutQuery>
</cfif>
</cfif>
<cflocation url="#MM_logoutRedirectPage#" addtoken="no">
</cfif>
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
<cfif IsNull(Session.MM_Username) EQ false>
<cfquery name="userinfo" datasource="everettweb">
SELECT Users.[First Name]
FROM Users
WHERE Users.Email = Session.MM_Username
</cfquery>
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="../main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a.headerlink:link {color: #FFFFFF;}
a.headerlink:hover {color: #D7A05D;}
a.headerlink:visited {color: #FFFFFF;}
a.headerlink:active {color: #FFFFFF;}
-->
</style>
</head>
<body>
<cfif IsNull(Session.MM_Username) EQ false>
<p class="loginstatus"><cfoutput query="userinfo">Welcome, #[First Name]#!</cfoutput> <a href="../register_edit.cfm" class="headerlink">My Account</a> / <a href="<cfoutput>#CurrentPage#?MM_logout=1</cfoutput>">Logout</a><img src="../images/clear.gif" width="40" height="20" border="0" /></p>
<cfelse>
<p class="loginstatus"><a href="../login.cfm" class="headerlink">Login</a> / <a href="../register.cfm" class="headerlink">Register</a><img src="../images/clear.gif" width="40" height="20" border="0" /></p>
</cfif>
</body>
</html>
