Ok, the error message is really odd. It almost looks like the httpd server isn't parsing PHP correctly and instead outputting all your PHP code. It seems as if it begins with the call to mysql_connect() but I don't see why.
Have you been successfully connecting to MySQL from this or another PHP script? Does this script have the .php extension (or the appropriate extension to parse PHP)?
Please use the provided PHP code tags when posting, it makes it much easier to spot errors, e.g.
PHP Code:
$variable = 'something';
Something else in your code important to mention; you're using addslashes()
and mysql_real_escape_string(). Bad combination. You're going to get slashes upon slashes in your stored data. Not to mention if you have
magic_quotes turned "On" as well, you'll have three sets of slashes. It can get intense.
Make sure magic_quotes is turned "Off", and use mysql_real_escape_string()
only.