First, thank you for the time you may give to reading and or responding to this
email.
I just recently started learning Coldfusion MX (6.1), and am finishing off my
first application. I am currently working on the login aspect of the
application, but, no matter what I do, cannot get it to work. I get an error,
which is not an exception, and really gives me no information whatsoever. The
error only happends if I put some sort of text into the username and password
boxes. The error is: "Error Occured While Processing Request" (not very
helpful). If I take the code from the Application page off, put it into another
page, delete my Application page, then run the normal page (hopefully that makes
sense) it works COMPLETELY FINE. I've read everything I can and can find no
help, I've been over the examples in the books, and tried everything I can think
of. So, I beseech you, members of House of Fusion, to help me.
Here's my Application.cfm page:
<cfapplication name="rwsummersAdmin" sessionmanagement="yes">
<cflogin idletimeout="60">
<cfif IsDefined("form.login")>
<cfquery name="userQuery" datasource="rwsummers">
SELECT username, password, roles FROM user WHERE username = '#form.username#'
</cfquery>
<cfif form.username EQ userQuery.username AND form.password EQ userQuery.password>
<cfloginuser name="#form.username#" password="#form.password#"
roles="#userQuery.roles#">
<cfelse>
<cfset message = "Incorrect username or password.">
<cfinclude template="login.cfm">
</cfif>
<cfelse>
<cfinclude template="login.cfm">
<cfabort>
</cfif>
</cflogin>
Here's the login.cfm page:
<html>
<head>
<title>login</title>
</head>
<body bgcolor="#FFFFFF">
<cfform method="post" action=""> <table width="721" border="1" align="center" cellpadding="0" cellspacing="0"
bordercolor="#000000" bordercolordark="#FFFFFF" bordercolorlight="#000000">
<tr>
<td><table width="721" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td colspan="2"><img src="" width="721"
height="108"></td>
</tr>
<tr bgcolor="#CCCC99">
<td colspan="2">
<p> </p></td>
</tr>
<tr bgcolor="#CCCC99" class="body">
<td colspan="2">Welcome, please login:</td>
</tr>
<tr>
<td colspan="2">
<cfif IsDefined("message")>
<cfoutput>
<span class="message">#message#</span>
</cfoutput>
</cfif>
</td>
</tr>
<tr>
<td width="77" valign="top" class="menuItem"><p>User name:</p>
</td>
<td width="644"> <p>
<cfinput type="text" name="username" required="yes" message="You
must enter a username to login.">
</p>
</td>
</tr>
<tr>
<td width="77" valign="top" class="menuItem">Password:</td>
<td><cfinput type="password" name="password" required="yes"
message="You must enter a password to login."></td>
</tr>
<tr>
<td width="77" valign="top" class="menuItem"> </td>
<td><input name="login" type="submit" id="login" value="Submit"></td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
</cfform>
</body>
</html>
Thanks so much for your time,
Trevor Smith
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
