Well, in the results.cfm page, you could get by with just this:
<CFQUERY name="CheckUser" datasource="Database">
SELECT UserID, Password
FROM passwords
WHERE UserID = '#Form.UserID#' AND Password = '#Form.Password#'
</CFQUERY>
<!--- if the query returns a row, then that means that the username and
password are both valid, otherwise, one of them is wrong --->
<CFIF CheckUser.RecordCount>
<CFOUTPUT>Welcome #Form.UserID#!</CFOUTPUT>
<CFELSE>
You entered an invalid username or password!
</CFIF>
etc.
This way, you don't have to make a seperate test for the password and you
also don't let the user know exactly which field is in error.
Todd Ashworth
|
| You can get rid of about 1/2 that code, and streamline the whole thing, as
a
| result.
|
| Todd Ashworth
|
| Well... uhm... just how would you do that? :)
|
| TIA,
| Pete
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.