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

[eluser]joshsmith[/eluser]
Hey,

I am currently trying to build a Registration form but i am stuck on the "security feature"; this is where they look at scramble # and letters and type in the same thing in a form below. They must get this right to register.

I'm stuck on creating this scrambled letters/numbers.

I also want to use this for verification check, so once they register the only way to activate it to go to their e-mail and click on the link ( i believe it should have a scrambled letter/number attached to it.


After registration say they forget their password i want to use the scrambled letter/number to reset their password via e-mail.

Is there any chance someone can show me how to produce scramble letters/numbers


Thanks in advance
#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;
    }




Theme © iAndrew 2016 - Forum software by © MyBB