Well, since some people have this problem I do not mind sharing a quick way to fix it.
<html>
<title>Space Remover Script</title>
<body>
<form method="post" name="removespace" action="removespace.php">
<b>Account: </b><input type="text" name="accountname" value=""><input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
<?php
$str = $accountname;
$strvalue = str_replace(' ', '', $str);
echo $strvalue;
?>
Basically it is reading the value of your post, then taking and storing it in the variable $str
then we create the variable $strvalue which is then calling the string replace which is str_replace then we tell it that where ever it sees a space ' ' to take and change that into '' which will remove any space in the post then we tell it to do this to the variable $str , and then we preform a simple echo to test it. Most people would not have the echo lol it would simply get INSERT INTO the table of choice and then that would be all.