It wouldn't be the HTML, cause the PHP is generating that error. It's obviously a problem with your SQL statment, which is the following piece of code:
Personally, I would change it to something like this:
$result = mysql_query("INSERT INTO users (user, password) VALUES ('$user', '$pass')")...