Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow I need a code generator

    I need a 16 digits php/mysql code generator, please

  • #2
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post
    find on google search engine. You'll definitely find one.
    Last edited by WA; 07-11-2009 at 01:38 AM.

  • #3
    Regular Coder FWDrew's Avatar
    Join Date
    Apr 2008
    Location
    Missouri
    Posts
    380
    Thanks
    38
    Thanked 45 Times in 43 Posts
    On it sir! When should I have that to you by? I know it's the weekend but I'm willing to work my butt off to fulfill this eloquent request. Do you need anything else done while I am at it? Perhaps some more code I could write for you, that way you don't have to learn anything!
    Dev-Tips.com || Employee at the Envato Network || My Portfolio

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by aikman View Post
    I need a 16 digits php/mysql code generator, please
    What do you mean code generator? Just a random 16 digit string?

  • #5
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    For digits:
    PHP Code:
        function CreateRandomCode($len) {
            
    $chars "1234567890";
            
    srand((double)microtime()*1000000);
            
    $string '' ;
            
    $len++;

            for (
    $i=0;$i<=$len$i++) {
                
    $num rand() % 33;
                
    $tmp substr($chars$num1);
                
    $string .=  $tmp;
            }
            return 
    $string;
        } 
    or
    PHP Code:
        function CreateRandomCode($len) {
            
    $chars "abcdefghijklmnopqrstuvwxyz1234567890";
            
    srand((double)microtime()*1000000);
            
    $string '' ;
            
    $len++;

            for (
    $i=0;$i<=$len$i++) {
                
    $num rand() % 33;
                
    $tmp substr($chars$num1);
                
    $string .=  $tmp;
            }
            return 
    $string;
        } 
    for letters and numbers


    Use the function like this:
    $random = CreateRandomCode(16);


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •