<cfquery name="Login" datasource="Users"> 
SELECT * FROM Login 
WHERE Usr_Name = '#form.Usr_Name#' 
AND Usr_Password = '#form.Usr_Password#' 
</cfquery> 

<cfif Login.RecordCount EQ 0> 
<!---INVALID---> 
<cflocation url="invalidlogin.cfm?"> 
<cfelseif Login.RecordCount EQ 1> 
<!---VALID---> 
<cflocation url="validlogin.cfm?"> 
</cfif> 
<!---end login_action.cfm---> 

If you get a greater then 1 recordcount, there is something wrong.  You need
to make sure you do not have duplicates, especially in the password table.


Eric


-----Original Message-----
From: Sangeeta Karmokar [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2003 2:12 AM
To: CF-Talk
Subject: Another Challenging question
Importance: Low


I am not sure how to add a new thread. So I am posting this message here.. 
I am a new user of CFMX and I am creating Login and Password page with
Access as Database. CAn anyone check as this CF script is ok: 

<cfquery name="Login" datasource="Users"> 
SELECT * FROM Login 
WHERE Usr_Name = #form.Usr_Name# 
AND Usr_Password = #form.Usr_Password# 
</cfquery> 

<cfif Login.RecordCount IS 0> 
<cflocation url="validlogin.cfm?"> 
<cfelseif Login.RecordCount IS GTE 1> 
<cflocation url="invalidlogin.cfm?"> 
<cfelse> 
</cfif> 
<!--end login_action.cfm--> 

Where Users is my datasource and Urs_Name and Urs_Password is my field
names. 

Please can anyone help me. 

Sangeeta
 
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to