Difference between revisions of "NATS4 custom errors.php"

From TMM Wiki
Jump to navigationJump to search
m
Line 30: Line 30:
  
 
'''WARNING: Do NOT display sensitive data.'''
 
'''WARNING: Do NOT display sensitive data.'''
 +
 +
[[Category:NATS4 Skins and Templates]]

Revision as of 14:22, 18 May 2011

NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
Skins and Templates Admin
The Skins and Templates Admin
Skins
Templates
Site Templates
Language Skins
Language Files
custom_errors.php
Join Page Variables
Skipping NATS Join Form
Post URL Variables
Member Usernames & Passwords
Form Validation
Username Recommendations
Password Retrieval
Post-Biller Templates
Geo-Target Join Options
Random Usernames and Passwords
Smarty
Smarty print array
Smarty Plugins
Available Smarty Functions
Affiliate Support Template
Adding a Verification Image
Custom Program and Campaign Selection Pages
Output An Affiliate's Last Paid Date
Affiliate Signup Email
Affiliate Join Page Linkcodes
Approval/Upgrade/Denial Variables
Approval/Upgrade/Denial Template Variables
CSS Theme Builder

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 admin. 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 these errors 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: Too Much Media's company policy states that no insertions or modifications are allowed to be made to the NATS database. If you wish to log error information in a database, please be sure to create a separate database for your logs.

WARNING: Do NOT display sensitive data.