PHP is writing this error in the logs: \"Notice: Use of undefined constant\".
Error in logs:
PHP Notice: Use of undefined constant
You should quote your array keys:
$department = mysql_real_escape_string($_POST['department']);
$name = mysql_real_escape_string($_POST['name']);
$email = mysql_real_escape_string($_POST['email']);
$message = mysql_real_escape_string($_POST['message']);
As is, it was looking for constants called department
, name
, email
, message
, etc. When it doesn't find such a constant, PHP (bizarrely) interprets it as a string ('department', etc). Obviously, this can easily break if you do defined such a constant later (though it's bad style to have lower-case constants).