Brad: you have a couple of Parse errors ... missing ";"'s in the DEFINE area ...
Code:
define('DB_HOST', 'localhost')
define('DB_USER', 'user')
Both need those pesky ;'s
EDIT: //
Also on the last line it should look like this
Code:
exec('mysqldump --add-drop-table -h ' .DB_HOST. ' -u' .DB_USER. ' -p' .DB_PASSWORD. ' ' .DB_NAME. ' 2>' .DUMP_PATH. '/error.txt >' .DUMP_PATH. '/' .DUMP_DATE. '.sql');
as you have a couple of extra bits you don't need ...
worked fine after that
Great idea!