Hey there
I'm trying to generate a username (retailer_user) and password (retailer_pass) from the first name and date. A user enters their first, surname and company into a form, on submit I have this code before adding to the db:
str_replace(" ", "", $first);
$first=htmlspecialchars($first);
str_replace(" ", "", $surname);
$surname=htmlspecialchars($surname);
$new_retailer = strtolower($first);
$retailer_user = $new_retailer;
$passtime = gmdate("Hi");
$retailer_pass = $new_retailer.$passtime;
This does work by generating a username and password, but if the user typed in their first name with a space after it, it would return something like:
lulubell 1215
and not
lulubell1215
Any ideas of where I am going wrong??:bemused: