content not displaying.
I built a login form and put an Application.cfc file in the folder i want to restrict and it's not displaying the simple text i put in the index.cfm for testing purposes.
======= Application.cfc code (in folder name "admin_section")==========
<cfcomponent>
<cffunction name="onRequest">
<cflogin>
<cfif IsDefined("FORM.Login_btn")>
<cfquery name="qLogin" datasource="poll">
SELECT UserLogin, UserPassword, UserRoleID
FROM Users
WHERE UserLogin = <cfqueryparam value="#FORM.UserName#" cfsqltype="cf_sql_varchar">
AND UserPassword = <cfqueryparam value="#FORM.Password#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfif FORM.username IS "#qLogin.UserLogin#" AND FORM.password IS "#qLogin.UserPassword#">
<cfloginuser name="#FORM.username#"
password="#FORM.password#"
roles="#qLogin.UserRoleID#">
<cfelse>
<cfset request.errorMsg = "Incorrect login; please try again">
<cfinclude template="../login/login.cfm">
<cfreturn>
</cfif>
<cfelse>
<cfinclude template="../login/login.cfm">
<cfreturn>
</cfif>
</cflogin>
</cffunction>
</cfcomponent>
======= Application.cfc End =======
====== Login Form (in folder name "Login" ====
<!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>
</head>
<body>
<cfform action="../admin_section/" method="post">
<table width="250">
<tr align="center">
<td colspan="2">
<cfif IsDefined('Request.errorMsg')>
<cfoutput>#Request.errorMsg#</cfoutput>
<cfelse>
Please Log in.
</cfif>
</td>
</tr>
<tr>
<td>
<font size="-1">User Name:</font>
</td>
<td>
<cfinput type="text"
name="UserName"
required="yes"
message="- You must enter a user name!">
</td>
</tr>
<tr>
<td>
<font size="-1">Password:</font>
</td>
<td>
<cfinput type="password"
name="Password"
required="yes"
message="- You must enter a password!">
</td>
</tr>
<tr>
<td> </td>
<td>
<cfinput type="submit" name="login_btn" value="Log me in!" >
</td>
</tr>
</table>
</cfform>
</body>
</html>
It takes me to the page, but nothing displays. Again i have simple text for testing purposes.
Any help would be great.
