Put this line at the top of your script and fix all errors/warnings (it's very important):
error_reporting(E_ALL);
Instead of
$mysql_id = mysql_connect('$host', '$user', '$pass');
mysql_select_db('$database', $mysql_id);
use varibles without quotes:
$mysql_id = mysql_connect($host, $user, $pass);
mysql_select_db($database, $mysql_id);
Typically you have to check for error whenever you access DB (check manual for mysql_connect, mysql_select_db, mysql_query):
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Not connected : ' . mysql_error());
}
// make foo the current db
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' . mysql_error());
}
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
These lines are unnecessary:
$username = stripslashes($username);
$password = stripslashes($password);
Instead disable magic quotes:
PHP: Disabling Magic Quotes - Manual
When you fix all issues I listed you will easily find any problem with your script.