View Full Version : Coldfusion login script

08-06-2004, 04:39 PM
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>

08-13-2004, 03:32 PM
try #user_name#

You will need the same info for the password too

try #user_pass#

<!--- 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#'

But remember this is directly from the user and has not been checked for hacking (sql injection and what not)

08-13-2004, 04:34 PM
Doh, i realised my stupid mistake. i did not change the form fields. The mistake was on my part. thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum