My 'Email Me' Error Function
I’ve become a big fan of using a ‘config’ file that I include at the beginning of all my PHP pages. Here I can set everything from global settings and variables, to site-wide functions…
One of the site-wide functions I use a lot sends an email if a script fails, i.e. do this and if it worked do this, else email error… It’s handy with database INSERT and UPDATE as you can let your user carry on without seeing an error, and then email yourself the entire SQL query for analysis and manual entry….
In my config.php file I have: