Hi I need some help. Ifind lots of tutorials for simple login and for using
cflogin in the Application...BUT nothing about using cf_login for single pages.
Here are the codes I am using and ALL that is happening is I am returned to the
login page everytime, if I enter correct or false data and NO error
message...PLUS there is no login happening. !. I put this code in the body of
my page I want to secure: <body> <cfif not len(getAuthUser())> <cfset
request.loginmessage = 'You need to Log In.'> <cfinclude
template='../LogIn/ForceUserLogIn.cfm'> </cfif> <!-- Get authorized user
suppled in Name of login tag --> <cfset ContactName =
ListFirst(GetAuthUser())> <cfoutput> <h2>Add or Edit a Event</h2>
<p><strong>WELCOME BACK, #ContactName#</strong></p> </cfoutput>
</body> I then have a login form; <!--- If the user is now submitting the
'login' form, include 'Login Check' code ---> <!--- to validate user ---> <cfif
IsDefined('Form.UserLogin')> <cfinclude template='LoginCheck.cfm'> </cfif>
<html> <head> <title>Log In</title> <meta http-equiv='Content-Type'
content='text/html; cht=iso-8859-1'> </head> <body> <!--- Start our Log in
Form ---> <cfform action='#CGI.SCRIPT_NAME#' name='LoginForm'
method='post'> <!--- Make the UserLogIn and UserPass fields required --->
<input type='hidden' name='UserLogIn_required'> <input type='hidden'
name='UserPass_required'> <table border='0' bgcolor='#FFFF00' align='right'>
<tr><Th colspan='2'>Please Log in</Th></tr> <tr></tr> <tr></tr> <tr>
<th>User Name (Alias): </th> <td> <!--- text field for user
name 'Alias' ---> <cfinput type='text' name='UserLogIn'
size='20' value='' maxlength='100'
required='yes' message='Please type your user name AKA Your User
Alias'> </td> </tr> <tr></tr> <tr></tr> <tr></tr> <tr>
<th>Password: </th> <td> <!--- text field for Password --->
<cfinput type='password' name='UserPass' size='20'
value='' maxlength='100' required='yes'
message='Please insert your user password.'> <!--- Submit button
that reads submit ---> <input type='submit' value='Log In'> </td>
<td> </td> </tr> </table> <p></p> <table> <tr> <td>
</td> <td><font size='+1' face='Comic Sans MS, MS Serif, Arial'>
Forgot your password? </font> <p></p> <font
face='Comic Sans MS, MS Serif, Arial'> Send it to your registered
Email address </font> </td> <td> </td>
<td> <a name='' onClick='window.open('./to email.cfm')'> <img
src='../Images/fastemail.gif'> </a> </td> </tr> </table>
</cfform> <cfinclude template='../head and foot/footer.cfm'> </table>
<cfinclude template='LogInFocus.cfm'> </body> </html> I then have a check if
they are logged in form; <!--- validates a user login name and password --->
<!--- first make sure we have a login name and password ---> <cfparam
name='Form.UserLogIn' type='string'> <cfparam name='Form.UserPass'
type='string'> <!--- find record with this user name and password ---> <!--- if
no rows returned one or both are not valid ---> <cfquery name='GetUser'
datasource='#REQUEST.DataSource#'> SELECT UserID, UserLogIn, UserCity,
UserState, UserCounty, UserCountry FROM Users WHERE UserLogIn
='#Form.UserLogIn#' AND UserPass ='#Form.UserPass#' </cfquery> <!--- If
the username and password are correct ---> <cfif GetUser.RecordCount EQ 1>
<!--- remember user's logged in status, plus ---> <!--- UserID and UserLogin
name in structure ---> <cfset SESSION.Auth = StructNew()> <cfset
SESSION.Auth.IsLoggedIn = 'yes'> <cfset SESSION.Auth.UserID = GetUser.UserID>
<cfset SESSION.Auth.UserLogIn = GetUser.UserLogIn> <!--- Now that user
is logged in, send them to whatever page they were trying to access --->
<cflocation url='#CGI.SCRIPT_NAME#'> </cfif> Nothing seems to be working
please help. I do not want a site that people have to log in to see anything as
with application. I only want to secure the areas where the user can add or
update their own info and for the site admin. Thank you John:disgust;