Hello guys, im trying to make an email activation script, but I have no clue what to use to make the script enter in a random number/letter string to use as the activation code. Anyone have any suggestions?
Thanks in advance.
Yeah, check out: http://www.php.net/uniqid
Originally posted by philipolson Yeah, check out: http://www.php.net/uniqid
Hmm seems very advanced and not newbie 😉
Cut-n-paste examples seems newbie to me, that manual page has them :-)
hehe well perhaps its easy, but I found rand() to be easy.
will it work for what I need?
<? $rand = rand(0,99999999999); print $rand; ?>
The question is; What will that code do? Take a guess...
Hint: Function prototype: int rand ( [int min, int max])
http://www.php.net/manual/en/about.prototypes.php
ok nm you made me see the light =p
<? $better_token = md5(uniqid(rand(),1)); print $better_token; ?>
works real well
hehe
Curious, what light did you see? My goal there was for you to learn how to use a function, and read a prototype. Please read that manual page and let me know if it makes sense. I wrote it and am wondering if newbies can understand it.
well, I read it over. The thing is, I know how to write lines without cut/paste. I am still learning all of the functions and such though. So I still need to ask what I would use for different instances.