Hola, warner.
Prueba esto:
Código PHP:
<html>
<head>
<script>
function noEspacio(e) {
if (navigator.appName == "Netscape") tecla = e.which;
else tecla = e.keyCode;
if (tecla == 32) return false;
else return true;
}
</script>
</head>
<body>
<input type="text" onKeyPress="return noEspacio(event)">
</body>
</html>
Saludos,