how to generate 6 character membership no?

shirzuis 11 Dec, 2011
hi there,

I want to generate 6 character membership number, i can't figure it out how to do it.
i found this code from php.net, but not sure how to use?😟
<?php
function randomAlphaNum($length){

    $rangeMin = pow(36, $length-1); //smallest number to give length digits in base 36
    $rangeMax = pow(36, $length)-1; //largest number to give length digits in base 36
    $base10Rand = mt_rand($rangeMin, $rangeMax); //get the random number
    $newRand = base_convert($base10Rand, 10, 36); //convert it
   
    return $newRand; //spit it out

}
?>  


can someone please help.
GreyHead 11 Dec, 2011
Hi shirzuis,

I have a CFv4 action to so this. See the Unique ID [GH] action here

Bob
shirzuis 11 Dec, 2011
hi Bob,

I am using cf 3.2.
will it work on cf 3.2?
GreyHead 12 Dec, 2011
Hi shirzuis,

No it won't work in CFv3; but there is an article from the ChronoForms book uhere that uses the almost same code in ChronoForms v3.

Bob
This topic is locked and no more replies can be posted.