i don't know why your form variable is undefined. when you redirect them back to password.cfm, don't forget to include the URL parameter for referer. (referer=#URL.linkPage#).
also you don't need that CFoutput around all those CF tags. Duncan Cumming IT Manager http://www.alienationdesign.co.uk mailto:[EMAIL PROTECTED] Tel: 0141 575 9700 Fax: 0141 575 9600 Creative solutions in a technical world ---------------------------------------------------------------------- Get your domain names online from: http://www.alienationdomains.co.uk Reseller options available! ---------------------------------------------------------------------- ---------------------------------------------------------------------- [EMAIL PROTECTED] ham.gov.uk To: [EMAIL PROTECTED] cc: 23/10/2003 14:54 Subject: [ cf-dev ] passsing stuff around Please respond to dev Another problem I have .... User comes to default page. User clicks link The page they are sent to checks for login ... <!--- Is user logged in ? ---> <cfif not isdefined("session.loggedin")> <cflocation url="loggedin/password.cfm?referer=individ.cfm"> </cfif> ..and passes the page name (individ.cfm) in the url The user isn't logged in so goes off to the password page and enters the password. <script language="JavaScript"> <!-- function submitForm() { document.form_name.clickme.value = "Please Wait..."; document.form_name.clickme.disabled = "disabled"; return true; } //--> </script> <form name="form_name" action="login_action.cfm?linkPage=#url.referer#" method="post" onsubmit="submitForm();"> <input type="Password" name="entered_user_name"> <input type="Password" name="entered_password"> <input name="clickme" type=submit value="Click Me"> </form> Now the user enters their username & password ok so the form calls login_action and passes the value linkPage which is the referer of the first page (individ.cfm) Username & password are checked all passes ok and then .... <cfoutput> <cfif password_query.RecordCount is 0> <cffile action="Append" file="#application.log#" output="#DateFormat("#Now()#")#, #TimeFormat("#Now()#")# ACCESS DENIED! username = #trim(form.entered_user_name)# Password = #trim(form.entered_password)#."> <cflocation url="../loggedin/password.cfm"> <cfelse> <cffile action="Append" file="#application.log#" output="#DateFormat("#Now()#")#, #TimeFormat("#Now()#")#, #password_query.users_name# LOGGED IN"> <cflock timeout="10" type = "exclusive" scope = "session"> <cfset session.loggedin="1"> <cfset session.user = " #password_query.users_name#"> <cfset session.access_rights = " #password_query.roles#"> </cflock> <cflocation url="#url.linkpage#"> </cfif> </cfoutput> the user is logged in all is tickety boo and off goes the page to url.linkpage which should be individ.cfm However i get an error Element ENTERED_USER_NAME is undefined in FORM Which going through this now it seems that I am stuck in some loop somewhere. Is there an easier way of doing this. cgi.referer will only bring the page refered at the time doesn't it hence I lose the individ.cfm ..... :( - Any ideas Regards - Paul ************************************************************************************************* The information contained within this e-mail (and any attachment) sent by Birmingham City Council is confidential and may be legally privileged. It is intended only for the named recipient or entity to whom it is addressed. If you are not the intended recipient please accept our apologies and notify the sender immediately, or telephone +(44) 121 303 6666. Unauthorised access, use, disclosure, storage or copying is not permitted and may be unlawful. Any e-mail including its content may be monitored and used by Birmingham City Council for reasons of security and for monitoring internal compliance with the office policy on staff use. E-mail blocking software may also be used. Any views or opinions presented are solely those of the originator and do not necessarily represent those of Birmingham City Council. We cannot guarantee that this message or any attachment is virus free or has not been intercepted and amended. ************************************************************************************************* -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
