Announcement

Collapse
No announcement yet.

random strings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • random strings

    hi folks,

    i'm looking to create a random string consisting of 11 characters (alphanumeric) to create a unique identifier for an email wine voucher so people can claim a free bottle of wine with it and only be able to use it once

    anybody got any ideas how i'd go about generating this string?


    cheers,
    Robert
    Visit NoizPollution.com // Your Music Source

    Do not PM or email me for support, you will not receive a response. Please post all requests for support in the main vBulletin forums or via the support system in the main members section of the site.

  • #2
    PHP Code:
    $randomstring substr(md5(microtime()), 011); 
    Would this do it?

    It can generate the same two random strings if two people access it within the same millisecond, but other than that it should be pretty random.
    Last edited by CeleronXT; Mon 5th Jan '04, 3:05pm.
    "63,000 bugs in the code, 63,000 bugs, you get 1 whacked with a service pack, now there's 63,005 bugs in the code."
    "Before you critisize someone, walk a mile in their shoes. That way, when you critisize them, you're a mile away and you have their shoes."
    Utopia Software - Current Software: Utopia News Pro (news management system)

    Comment


    • #3
      celeron that's exactly what i'm looking for

      much appreciated,
      Robert
      Visit NoizPollution.com // Your Music Source

      Do not PM or email me for support, you will not receive a response. Please post all requests for support in the main vBulletin forums or via the support system in the main members section of the site.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X