Replace the following functions set to...
mysql_query($databasehandle,"INSERT INTO users (Username, Password) VALUES ($user, $pass)");
mysqli_error($databasehandle);
mysqli_close($databasehandle);
As you can see, they all have to be assigned to the MySQL server so PHP knows where the error is...