Det ser ud til, at fejlen er i PHP-koden.
Skift følgende linje:-
Fra:
$query = mysql_query("SELECT * FROM user WHERE username = '$un' AND password = '$pw'");
Til:
$query = "SELECT * FROM user WHERE username = '$un' AND password = '$pw'";
Du bør også overveje at foretage ændringer for at forhindre SQL Injection:-
$query = sprintf("SELECT * FROM user WHERE username =
WHERE username='%s' AND password='%s'",
mysql_real_escape_string($un),
mysql_real_escape_string($pw));