You could do something like this (note I am using createUUID() to generate a
primary Key. You can use whatever method you like):
<cfquery ..>
Insert into table
(id, name, password)
VALUES
('#createUUID()#',
<cfqueryparam type="CF_SQL_VARCHAR" value="#form.name#">,
<cfqueryparam type="CF_SQL_VARCHAR" value="#hash(form.password)#">)
</cfquery>
And then:.
<cfquery ..>
Select * from table
Where name = <cfqueryparam type="CF_SQL_VARCHAR" value="#form.name#">
and password = <cfqueryparam type="CF_SQL_VARCHAR"
value="#hash(form.password)#">
</cfquery>
Use <cfqueryparam> whenever using user supplied info in db queries.
Mike
-----Original Message-----
From: Mark Collins [mailto:[email protected]]
Sent: Thursday, April 30, 2009 11:12 AM
To: cf-newbie
Subject: Re: Help with registration page
Thanks. So my form.password variable is passed to hash() before I insert
into the database. And I do the same when authenticating?
________________________________
From: Mike Chytracek <[email protected]>
To: cf-newbie <[email protected]>
Sent: Thursday, April 30, 2009 10:36:27 AM
Subject: RE: Help with registration page
If you want to secure the passwords in the database you can hash() them
before putting them in and check the hash when authenticating.
Mike
-----Original Message-----
From: Mark Johnson [mailto:[email protected]]
Sent: Thursday, April 30, 2009 11:10 AM
To: cf-newbie
Subject: Help with registration page
I'm creating a registration page. When the user registers I want them to be
emailed an activation link that they need to click on in order to activate
their account. How can I creat this random number(hash).
HOw would I go about hashing newly created passwords for sign up forms?
Thanks for any help.
Mark
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4544
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15