Hi,
I'm going to take a look at your random password generator.
$x=0;
while ($x<10)
{
$type=rand(1,3);
if ($type==1)
{
$UL=chr(rand(65,90));
$pwd .= $UL;
};
if ($type==2)
{
$LL=chr(rand(97,122));
$pwd .= $LL;
};
if ($type==3)
{
$num=rand(0,9);
$pwd .= $num;
};
$x+=1;
};
echo "$pwd<br>";
I notice that you're generating it as lower and upper case alpha, and digits. If you were willing to make it just plain alphanumerics then you could use a method shown in the PHP manual here. I've changed it slightly to use [man]mt_rand[/man] instead and also chopped it to 10 characters.
$pwd = substr(md5( uniqid( mt_rand() ) ), 0, 10);
If upper and lower case is required there's not a lot I would change really. You could use a for loop rather than a while (that's what they're for), also, maybe a switch instead of three ifs and definately mt_rand instead of rand. So, let's see how that might look.
$pwd = '';
for($i=0; $i<10; $i++) {
switch( mt_rand(1, 3) ) {
case 1:
$c = char( mt_rand(65, 90) );
break;
case 2:
$c = char( mt_rand(97, 122) );
break;
case 3:
$c = mt_rand( 0, 9 );
break;
}
$pwd .= $c;
}
echo $pwd . "<br />";