you could try this archaic bit of code written for CF4.5, but should still
work:)

<cfset rString = "">
<!--- helps with proper randomizing:) --->
<cfset temp = Randomize("#day(now())##minute(now())##second(now())#")>
<cfset alpha = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z">
<cfloop from="1" to="15" index="ii">
 <cfset variableuse = randrange(1,2)>
 <cfif variableuse eq 1>
  <cfset rString = listappend(rString, listgetat(alpha, randrange(1,26)))>
 <cfelse>
  <cfset rString = listappend(rString, randrange(0, 9))>
 </cfif>
</cfloop>
<cfset rString = replace(rString, ",", "", "ALL")>
<cfoutput>#rString#</cfoutput>


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 17, 2003 2:29 PM
Subject: [ cf-dev ] Creating a random string


> Does anyone have any code to hand that will create a random string for the
> use as an activation code which will be emailed to users when they sign up
> to my web site.
>
> Cheers,
>
> Chris
>
> British Telecommunications plc
> Registered office: 81 Newgate Street London EC1A 7AJ
> Registered in England no. 1800000
> This electronic message contains information from British
Telecommunications
> plc which may be privileged or confidential. The information is intended
to
> be for the use of the individual(s) or entity named above. If you are not
> the intended recipient be aware that any disclosure, copying, distribution
> or use of the contents of this information is prohibited. If you have
> received this electronic message in error, please notify us by telephone
or
> email (to the numbers or address above) immediately.
> Activity and use of the British Telecommunications plc E-mail system is
> monitored to secure its effective operation and for other lawful business
> purposes. Communications using this system will also be monitored and may
be
> recorded to secure effective operation and for other lawful business
> purposes.
> Any views expressed in this email do not reflect those of BT and any of
> partners and assosiates. Responsiblity for the opinions expressed are
those
> of the sender only
>
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to