Thanks again - I have done some research and I think I have done this correctly. If so, how can I test this - It works with my modifications but I don't know if it is working, as the problem is random?
/
Calculate random username
/
if ( $type_address =="P" ) {
mt_srand((double)microtime() 10000000);
$number_id = mt_rand(1,9999);
$tempstring = substr($first_name,0,2);
$username = $tempstring . substr($last_name,0,2). $number_id;
$username = strtolower($username);
$username = preg_replace('/[a-z0-9]/i', '', $username);
}
if ( $type_address =="B" ) {
mt_srand((double)microtime() * 10000000);
$number_id = mt_rand(1,999);
$tempstring = substr($company,0,3);
$username = $tempstring . substr($last_name,0,3). $number_id;
$username = strtolower($username);
$username = preg_replace('/[a-z0-9]/i', '', $username);
}
$company = escapeshellcmd($company);