NATS4 custom errors.php
NATS typically uses very simple error messages to display messages. These error displays tend to be for support personnel, and thus do not contain much information relevant to you as a program owner and Ct#Admin (Person,NATS). NATS4 now offers customization of NATS's error handling and error messages through custom_errors.php
custom_errors.php
To use our custom errors script, you must first create a file in nats/includes/ called custom_errors.php. This file can contain anything you may want to display to a surfer, affiliate, or admin; you can also record to this error if you choose.
Note: Please make sure you read this entire article before creating your own custom_errors.php script, including the last section-- Warnings and Recommendations.
You will be able to access the following PHP variables in your custom_errors.php script:
- $errstr - This variable contains the actual text of the error message.
- $errfile - This variable contains the file from which the error was encountered.
- $errline - This variable contains the line number of the file contained in $errfile.
Note: You will not be able to use the error file and line number yourself. For additional security, all Too Much Media product's PHP files are encoded, and cannot be debugged by our end-users. For further assistance, please Submit a Support Ticket.
As custom_errors.php is a PHP script, you will have access to the full power of PHP, including PHP superglobal variables. As a result, you will be able to make your custom_errors.php script do essentially anything you want it to do.
Warnings and Recommendations
This script may not always run-- in the case of some errors or server crashes, this script may not execute. If there is a critical PHP component that is failing, for example, NATS will not run long enough to process the error.
If you are reporting your errors to a MySQL database and NATS has a problem with the MySQL server, there will be no way for custom_errors.php to report the error to the database.
WARNING: Do not use the NATS database to log errors. If you are reporting your errors to a MySQL database, make sure you create a separate database. This is because your script may include the database username, password, and host information in plain text. If you use the NATS database login information or that of any secure database, you may risk exposing your login information to the public. If this script modifies the content of your NATS database table structure or data content, we will not be able to fix your problems.
WARNING: Do NOT display sensitive data.