Password Help ASAP please!

Discussion in 'Programming' started by craig1510, May 3, 2007.

  1. #1
    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!!
     
    craig1510, May 3, 2007 IP
  2. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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.
     
    IsRoss(), May 3, 2007 IP