Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Coldfusion login script

    How do i define the variable username in this statement? The code is from here: http://tutorial8.easycfm.com/

    Variable USERNAME is undefined.

    The Error Occurred in C:\CFusionMX\wwwroot\login_process.cfm: line 5

    3 : SELECT Username, Password
    4 : FROM tblStudents
    5 : WHERE Username = '#Username#'
    6 : AND Password = '#Password#'
    7 : </cfquery>
    Last edited by sagat; 08-07-2004 at 08:19 AM.

  • #2
    New Coder
    Join Date
    Nov 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try #user_name#
    or
    #FORM.user_name#

    You will need the same info for the password too

    try #user_pass#
    or
    #FORM.user_pass#

    Code:
    <!--- Get all records from the database that match this users credentials --->
    <cfquery name="qVerify" datasource="userLogin">
        SELECT             user_name, user_pass
        FROM                tblAdmins
        WHERE              user_name = '#user_name#'
                         AND user_pass = '#user_pass#'
    </cfquery>
    But remember this is directly from the user and has not been checked for hacking (sql injection and what not)
    Last edited by Darknight; 08-13-2004 at 04:37 PM.

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Doh, i realised my stupid mistake. i did not change the form fields. The mistake was on my part. thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •