![]() |
Okay - I was so happy with this hack that I'm going to help improve it. Hopefully, you will find this usefull...
What this does is, for 404 and 500 errors, the server will send you an email notifying you of the error, and providing some information that will assist you in resolving it. open error.php and find: Code:
$error['title'] = "404 File Not Found"; Code:
$error_message = "An attempt to get a file (". $_SERVER['REQUEST_URI'] . ") failed. Please investigate!\r\n"; Code:
$error['title'] = "500 Internal Server Error"; Code:
$error_message = "An attempt to get a file (". $_SERVER['REQUEST_URI'] . ") caused an error. Please investigate!\r\n"; find Code:
eval("print_output(\"".fetch_template('ERROR_SHELL')."\");"); Code:
$error_headers = ""; Save and upload the file and test by going to a non-existing page on your site. You should receive the email right after that. |
couple things with that.
missing the headers to do html mail or something. the error_start and error_footer will never get appended to the body |
You are correct. I could have swore I removed the error_start and error_footer stuff before I posted that. I use that for something else.
Also, I've changed some of the hard coded email addresses to the $vboptions['webmasteremail'] variable. Would it be easier (and allowed) for me to just attach the php file here? It's just the original error page with my stuff added. Whatever is convenient (and doesn't break the rules)..... |
Nice addition, 58sniper!
I'd be only worried to be flooded with e-mails (at least if you have a high traffic site). Although my site is relatively small, for June 2004 I had 3864 404-Document Not-Found-errors, in May even 5048 of these errors. Not because I am sloppy with html programming, but because people (or bots, in majority) were trying to access and spider outdated links. |
The biggest problem I've seen is the PowerPC version of IE. It apparently has poor support for images in CSS. I think I'm going to filter that.
What's the rule about modifying hacks? Do I just post the new file here or do I need to start a new thread and give props? I ask because I'd like to switch all of the IF statements to a switch, and make a few more changes, and I think the new version would be beneficial. |
Great addition. Thanks.
|
Okay - here we go. This is an 'extension' of this hack, which includes:
- Emailing of the webmaster for 404 and 500 errors. - Changed all of the IF ELSE statements to a single SWITCH - Used more vBulletin variables so that no code modification is required to implement this. I've tested this for a couple of days, and haven't seen any problems. Let me know if you spot any. To install, just drop this in your forum folder, overwriting the original (which, of course, you backed up). |
Updated with the following changes:
Subject of error email now indicates type of error. Address of referring page (if it exists) is now a link. This is a straight drop-in replacement for the above. |
This hack was Wrorking With me B4 After We update our Server . it dont work
Can i know what this hack need from me to install any software or anything .. Thankyou |
Quote:
|
All times are GMT. The time now is 10:16 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|