Code:
<?php
//set the
random id
length
$random_id_leng
th = 10;
//generate a
random id
encrypt it and
store it in
$rnd_id
$rnd_id =
crypt(uniqid(ra
nd(),1));
//to remove any
slashes that
might have
come
$rnd_id =
strip_tags(stri
pslashes($rnd_i
d));
//Removing any
. or / and
reversing the
string
$rnd_id =
str_replace(&qu
ot;.",&quo
t;",$rnd_i
d);
$rnd_id =
strrev(str_repl
ace("/&quo
t;,""
,$rnd_id));
//finally I
take the first
10 characters
from the
$rnd_id
$rnd_id =
substr($rnd_id,
0,$random_id_le
ngth);
echo
"Random
Id:
$rnd_id";<
br />
?>
One outcome
from this
script make
this password:
041TbPATvW
Can someone
help me remove
the capitals
letters from
the script dont
show in the
password.
And I want to
give my users
some choises,
that they can
choose number,
letters. Or a
combination
like the code
above
sry language
and grammar
mistakes.
|