View Single Post
Old 04-08-2010, 09:08 PM   PM User | #10
suzierthanyou
New Coder

 
Join Date: Jul 2008
Posts: 31
Thanks: 3
Thanked 0 Times in 0 Posts
suzierthanyou is an unknown quantity at this point
my login form:

Code:
<cfif isDefined( 'url.invalidLogin' )>
        <font color="red">You have entered an invalid username/password. Please try again.</font>
		
  
      <cfform name="login" action="http://newmedia.leeds.ac.uk/ug06/cs06sr/cf/login_process.cfm" method="post">
<table width="130" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td width="130"><div align="right">
      <cfinput type="text" class="loginform" name="username" value="Username" onFocus="this.value=''">
    </div></td>
  </tr>
  <tr>
    <td>        <div align="right">
          <cfinput type="password" class="loginform" name="password" value="password" onFocus="this.value=''">        
          <cfinput name="submit" type="submit" class="loginformbutton" value="Log In">    
        </div></td>
  </tr>
</table>
<br>
</cfform>

 <cfelse>You're logged in as <cfoutput>#getauthuser()#</cfoutput> 
 <a href="logout.cfm">logout</a>

 </cfif>
my login_process
Code:
<cfquery name="checkUser" datasource="062105cs06sr">
    SELECT * FROM users
    WHERE username = '#form.username#'
        AND password = '#form.password#'
</cfquery>

<cfif checkUser.recordCount eq 1>
    <!--- A user record was found for the username/password, log them in --->
    <cfset session.loggedIn = true>
    <cflocation url="memberWelcome.cfm">
<cfelse>
    <!--- A user record was not found for the username/password, send them back to the login page --->
    <cflocation url="cfhome.cfm?invalidLogin=true">
</cfif>
my logout
Code:
<cflock scope="session" type="exclusive" timeout="10">
    <cfset session.loggedIn = false>
</cflock>


<cflocation url="cfhome.cfm">

I have been trying to get my head around this for AGES and it's not happening!
suzierthanyou is offline   Reply With Quote