For your information and perhaps others. You did have one error....
<PRE>
$name = ereg_replace (" ", "", $thenamehere);
$finalname = ereg_replace (".", "", $name); //error here.
$name = ereg_replace (" ", "", $thenamehere);
$finalname = ereg_replace (".", "", $name); //you have to escape the "." as a regex char.
</PRE>
🙂 just thought you should know,which i'm sure you already did but overlooked.
Marcel.