Forums
This topic is locked
Login always redirect to failed login page ??
Posted 13 Jun 2007 14:54:09
1
has voted
13 Jun 2007 14:54:09 Ann Lambin posted:
Hi there !Using DWMX2004 with Coldfusion and Access 2003, I built a simple login page using the login server behavior, BUT.... I'm always redirected to the failed login page (even with a correct username and password) !
Any idea ???
I've also built another "new user" registration page with the user authentication server behavior and using the same table and it works perfectly fine.
I am puzzled... <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>(((
Thanks in advance for your help!
Here is the code of the login page:
<cfif IsDefined("FORM.myEmail"
<cfset MM_redirectLoginSuccess="login_ok.htm">
<cfset MM_redirectLoginFailed="login_failed.htm">
<cfquery name="MM_rsUser" datasource="Calliope">
SELECT UserEmail,UserPass FROM tblUsers WHERE UserEmail='#FORM.myEmail#' AND UserPass='#FORM.myPass#'
</cfquery>
<cfif MM_rsUser.RecordCount NEQ 0>
<cftry>
<cflock scope="Session" timeout="30" type="Exclusive">
<cfset Session.MM_Username=FORM.myEmail>
<cfset Session.MM_UserAuthorization="">
</cflock>
<cfif IsDefined("URL.accessdenied"
<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 & "?" & XMLFormat(CGI.QUERY_STRING)>
</cfif>
</cfif>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="<cfoutput>#MM_loginAction#</cfoutput>" method="POST" name="txtLogin" id="txtLogin">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24%">Email</td>
<td width="76%"><input name="myEmail" type="text" id="myEmail"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="myPass" type="text" id="myPass"></td>
</tr>
<tr>
<td> </td>
<td><input name="Login" type="submit" id="Login" value="Login"></td>
</tr>
</table>
</form>
</body>
</html>