The problem is with your MySQL Connection. Remove mysql_real_escape_string()
before opening a MySQL Connection. Generally, your web server will have a different username and password from your local xampp account. Change them.
Also, a best practice is not to use mysql_*
functions, instead replace them with mysqli_*
or PDO
.