[ic] [counter]

Ron Phipps interchange-users@interchange.redhat.com
Thu Mar 28 21:00:00 2002


> From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-
> users-admin@interchange.redhat.com] On Behalf Of Jim Webster
> 
> I've been reading up on the [counter] tag on the IC resource site.
> 
> I need a form to auto generate a random 3 digit numerical code and
insert
> it
> into a database table.  I'd like the numbers to be very speratic such
as
> "784" and the next one might be "239", etc.

I don't think the [counter] tag is what you want.  The [counter] tag
generates sequential numbers.  Can the same key be assigned to more then
one customer? You could try embedded perl using Perl's 'rand' function.
If the same key cannot be re-used then you'll want a larger key and
you'll need to check the generated key against all keys in the userdb to
make sure that key has not been used.

Good luck,
-Ron

> 
> More info on my appliation:
> 
> New customers will receive this "key" in their email to verify they
> entered
> a valid email address.  The last step of the signup process will ask
them
> for this key.
> 
> Can someone provide an example using this tag?  I don't see anything
in
> the
> archives relating to this topic.. thanks.
> 
> 
> Jim Webster
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users