Random number for each registered user

marimo 06 Jan, 2008
Hi,

i would like to know how possibly can i make that for any registered user by my chronoform will be assign 12 digits unique number for each of them?

Thank you.
GreyHead 06 Jan, 2008
Hi marimo,

Do you want these 12 digit numbers to come from a list? Or to be random? or to be related to their Joomla User_ID number?

Bob
marimo 07 Jan, 2008
Hi,

I thought that the unique number is similar to bank account for my client membership system.I prefer random number.

Thank you for reply.
GreyHead 07 Jan, 2008
Hi marimo,

This code will generate a 13 character number:
$unique = uniqid();
. If you include this as a hidden field in your form it will most likely be unique unless your membership is very large. If you want to remove the small risk of a duplicate then you'd need to test the database before writing and generate a newcode if this one already exists.

I found some useful tips in this thread (thanks to Google).

Bob

See the PHP help for uniqid() for more info.<br><br>Post edited by: GreyHead, at: 2008/01/06 19:31
marimo 07 Jan, 2008
hi,

thank you for reply,could you help me to insert the code in properly manner?

tq.
GreyHead 07 Jan, 2008
Hi marimo,

Not easily, no. If you post a backup copy of your form and write a clear spec for what you want to do then maybe. If it's really simple then maybe it can be done here. If it's more complex then you may need to pay someone to do it for you.

Sorry not to be more helpful but what we do here is to support ChronoForms and this request is much more about application coding.

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