Re: Name bug
despite HD's solution is the most practical, it will trim all spaces within the string, so if you want a name like "Haunted Dawg" it'll become "HauntedDawg" using trim().
the best yet not the fancy if you want to simply avoid first and/or last spaces (or other chars) use rtrim() combined with ltrim()
http://uk2.php.net/manual/en/function.ltrim.php
http://uk2.php.net/manual/en/function.rtrim.php
@Feky: it doesn't leave the space unless you misuse it. my suggestion... follow the examples on the above pages :)