> Whats up with this ? > Seems like the comparison is allowing any 'ole case to cause > the <cfif compare to be 'true'. > > <cfset asod = tobinary(theUser.pw)> > <cfset asod = tostring(asod)> > <cfset asod = cfusion_Decrypt(asod, Hash(UCase(theUser.UserName)))> > <cfif asod EQ Attributes.password> > <cfset goodlogin = "YES"> > <cfelse> > <cfset goodlogin = "NO"> > </cfif> > > <cfoutput> > asod = #asod#<br> > Attributes.password = #Attributes.password#<br> > GoodLogin = #GoodLogin#<br> > </cfoutput> > > ------------------------------------- > --- output is cut and pasted here--- > ------------------------------------- > asod = aaaaaa > Attributes.password = aaaAAA > GoodLogin = YES
When you compare strings using the IS or EQ operators, your comparison is case-insensitive. If you want to perform a case-sensitive comparison, use the Compare function: <cfif not Compare(asod, Attributes.password)> Note that this function returns zero if the strings match exactly, so you can precede it with the NOT operator as shown above. If the strings aren't identical, you'll get a value of 1 or -1, which both evaluate to true in CF's automatic evaluation of integers to boolean values. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

