damiancds Posted April 5, 2010 Share Posted April 5, 2010 To start, I've already set up a custom 404 error page, which works.What i'd like to add is an automatic error report that is sent to an email.I've fooled around with other mailing forms which all work, but I'm not sure how to set up one that is sent automatically.I just found out that i won't be able to retrieve the user's previous page, so right now i just need to know how to send an email automaticallyif you caught all that, any advice would be appreciated.thanks, Link to comment Share on other sites More sharing options...
jeffman Posted April 5, 2010 Share Posted April 5, 2010 If your custom 404 is a php script it should be able to use the PHP mail function before outputting the html. You can certainly run PHP code; I do this; so sending mail should not be a problem.Do you redirect your users to your 404 page through settings in your .htaccess file? This technique allows you to redirect to any kind of file, including a .php file. Link to comment Share on other sites More sharing options...
damiancds Posted April 5, 2010 Author Share Posted April 5, 2010 Yeah, I've got it so it works, I just basically took the example from my form, and just cut out the form part of it so now it automatically sends an email when that page is loaded.thanks,EDIT:I started to try to do a hybrid javascript/php (because I wanted to get the previous page) but someone turned me onto the $_SERVER array which worked beautifully, so this will stay as just php and I don't have to worry about people without the javascript Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.