change your @ function calls and change them to or die's, ie. instead of:
@mysql_connect("localhost", "username", "password")
use
mysql_connect("localhost", "username", "password") or die( mysql_error() )
The @ suppresses errors, and the most likely problem is an error, so we want to see them - the or die() allows us to stop teh script with an optional message, and in this case, if a mysql fun fails, mysql_error() returns the reason it failed, so it is ideal.
And it's amazingly simple for even the best php coders to typo a username or password, or forget which database they mean to use, or similar 🙂 (although, in the code above, that shouldn't prevent the html output, but it is a good place to start)
also, adding a line like:
error_reporting(E_ALL);
or
error_reporting(E_ALL ^ E_NOTICE);
can help also in figuring out errors assuming it hides them by default.