I have set up a password system on login.cfm page, which when entered correctly, shoudl take the user to backendmenu.cfm page. However, when entering the password correctly, i am receiving an error message which is saying USERNAME is undefined, like so... Variable PASSWORD is undefined. The error occurred in C:\CFusionMX7\wwwroot\backendmenu.cfm: line 36 34 : <cfelse> 35 : 36 : <cfif ucase(password) is '1510TKJMPF'> 37 : <cfcookie name=bestbooks value='boss'> 38 : <cflocation url="backendmenu.cfm"> Here is the code I am using on the login.cfm file... <cfif isdefined ("cookie.bestbooks")> <cflocation url="login.cfm"> <cfelse> <form action="backendmenu.cfm" method="POST"> Password:<br> <input type=password name=password<br> <br><br> <input type=submit value=" OK "> </form> </cfif> Here is the code i am using on the backendmenu.cfm file... <cfif isdefined("cookie.bestbooks")> <body> <cfelse> <cfif ucase(password) is '1510TKJMPF'> <cfcookie name=bestbooks value='boss'> <cflocation url="backendmenu.cfm"> <cfelse> <cflocation url="login.cfm"> </cfif> </cfif> </body> Any help will be much appreciated!!
I would try scoping the variable e.g. form.password. You should also put in your backenedmanu page <CFPARAM name="password" default="">. This will prevent an error being thrown if the password field is left empty.