This can be used to verify the user and generate a random password -- teaman
<?
//----------------------------------------------------
// Function GetSID ()
//
// Parameters: $ nSize number of caracters, default 24
// Return value: 24 caracters string
//
// Description: This function returns a random string
// Of 24 caracters that can be used to identify users
// On your web site in a more secure way. You can also
// Use this function to generate passwords.
//----------------------------------------------------
Function GetSID ($ nSize = 24 ){
// Randomize
Mt_srand (double) microtime () * 1000000 );
For ($ I = 1; $ I <= $ nSize; $ I ++ ){
// If you wish to add numbers in your string,
// Uncomment the two lines that are commented
// In the if statement
$ NRandom = mt_rand (1, 30 );
If ($ nRandom <= 10 ){
// Uppercase letters
$ SessionID. = chr (mt_rand (65,90 ));
//} Elseif ($ nRandom <= 20 ){
// $ SessionID. = mt_rand (0, 9 );
} Else {
// Lowercase letters
$ SessionID. = chr (mt_rand (97,122 ));
}
}
Return $ sessionID;
}
// Test the function
Echo GetSID (16 );
?>