Welcome Guest, Not a member yet? Register   Sign In
Creating random numbers and letters
#2

[eluser]jblack199[/eluser]
creating the captcha could be done via the CI captcha helper:

http://ellislab.com/codeigniter/user-gui...elper.html

and creating say a temporary password / registration code can be done using php easy enough.. here is my function i used previously (not in CI) to create a temporary password.

Code:
function createRandomPassword() {
        $chars = "abcdefghijklmnopqrstuvwxyz0123456789";
        srand((double)microtime()*1000000);
        $i = 0;
        $pass = '';
        
        while ($i <= 7) {
            $num = rand() % 33;
            $tmp = substr($chars, $num, 1);
            $pass = $pass .$tmp;
            $i++;
        }
        
        return $pass;
    }


Messages In This Thread
Creating random numbers and letters - by El Forum - 08-13-2011, 02:32 PM
Creating random numbers and letters - by El Forum - 08-13-2011, 02:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB