hi guys,

im having problems with my login page, below are the following pages,

application.cfm
login_process.cfm
login.cfm

the problem is that if i type in the correct user name and password it gets redirected to another page, not the page that i want, what could be the problem??

(APPLICATION.CFM)
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<cfapplication name="MyApp" clientmanagement="Yes"
                   sessionmanagement="Yes"
                   sessiontimeout="#CreateTimeSpan(0,0,15,0)#"
                   applicationtimeout="#CreateTimeSpan(0,2,0,0)#">

<!--- Now define that this user is logged out by default --->
<CFPARAM NAME="session.allowin" DEFAULT="false">

<!--- Now if the variable "session.allowin" does not equal true, send user to the login page --->
<!---
the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page
and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked
the application will simply Loop over and over. To check that, you do the following call


--->
<cfif session.allowin neq "true">
     <cfif ListLast(CGI.SCRIPT_NAME, "/") EQ "login.cfm">
     <cfelseif ListLast(CGI.SCRIPT_NAME, "/") EQ "login_process.cfm">

     </cfif>
</cfif>


</body> </html>


lOGIN_PROCESS.CFM


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<cfparam name="Form.Username" default="">
<cfparam name="Form.Password" default="">


<cfif NOT Len(Trim(Form.Username)) OR NOT Len(Trim(Form.Password))> <!--- one or both of these is blank, redirect them ---> <cflocation url="login.cfm?error=Length"> </cfif>

<cfquery name="qVerify" datasource="userLogin">
    SELECT             user_name, user_pass
    FROM                tblAdmins
    WHERE              user_name = '#Form.Username#'
                     AND user_pass = '#Form.Password#'
</cfquery>

<cfif NOT qVerify.RecordCount>
<!--- no results found, redirect them --->
    <cflocation url="login.cfm?error=NotFound">
<cfelse>
<!--- Found their details, take them to the members-only page --->
    <cflocation url="http://localhost/frontpage.html";>
</cfif>
</cfelse>

</body>
</html>

LOGIN.CFM

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#D1DDE9"><body>
<p align="center"><font color="#000000" size="6" face="Arial, Helvetica, sans-serif"><strong>Financial News Image
Database</strong></font></p>
<p>This section is for Authorised users only</p>
<p><a href="http://localhost/frontpage.html";>Homepage</a></p>
<p>&nbsp;</p>
<cfparam name="URL.error" default="">


<form name="login" action="process_login.cfm" method="POST">
    <cfif URL.error EQ "Length">
   <div align="center">Please enter your Username and Password<br>
     <cfelseif URL.error EQ "NotFound">
     <p>This Username and Password wasn't found. Please try again<br>
     </p>
   </div>
 </cfif>
 <div align="center"> Username:
   <input type="text" name="Username">
   <font color="#D1DDE9"></font><br>
   Password:
   <input type="password" name="Password">
   <br>
   <input type="Submit" value="Login">
   <input type="reset" name="Reset" value="Reset">
 </div>
</form>

</body>
</html>

_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess



-- These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/ Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
     *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
          *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]



Reply via email to