i have a random password generating system on my website for when members
join the cf code that achieves this is as follows i hope this is of some
help

<cfset random_word = "">
<cfloop index="ii" from="1" to="4">
<cfset random_number = "#RandRange(1,25)#">
<cfset alphabet = "abcdefghijkmnopqrstuvwxyz">
<cfset random_letter = "#Mid(alphabet,random_number,1)#">
<cfset random_word = "#ListAppend(random_word,random_letter)#">
</cfloop>
<cfset random_word = "#Replace(random_word, ",", "", "ALL")#">
<cfset random_number = "#RandRange(1000,9999)#">
<cfset password = "#random_word##random_number#">




----- Original Message -----
From: "David Cummins" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 07, 2000 3:25 PM
Subject: Re: generating random passwords for a db field


I think the issue is that he's hoping he can do it entirely in SQL, using
random
functions in SQL. I believe I had a similar problem, i.e. that SQL only
generated the random number once, not once for each row. Perhaps
optimisation
gone awry?

You could do it in any of the ways that were suggested, but you're sending a
lot
of individual commands to the SQL engine if you want to generate passwords
for a
large number of people.

David Cummins

Steve Reich wrote:
>
> A custom tag seems to be the easy answer, but to solve the problem of why
> you are getting the same random number with RandRange seems to be your
> issue. You need to use the Randomize function to generate a random seed
> value along with RandRange to generate your random numbers. You can find
> more information and examples in the CFSTU help file...
>
> HTH,
> Steve
>
> "Shane Witbeck" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > What is the BEST way to generate random passwords to populate an
existing
> field in a db. I tried using the RandRange(1, 10000) function to do this
but
> wound up generating the same random number for every record instead of a
> different random number for every record.
> >
> > The passwords generated do not nec. have to be a number, it could be
> alphanumeric.
> >
> > TIA
> >
> > Shane Witbeck
>
> --------------------------------------------------------------------------
> ----------------------
> > Archives: http://www.mail-archive.com/[email protected]/
> > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or
send
> a message with 'unsubscribe' in the body to
> [EMAIL PROTECTED]
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to