Difference between revisions of "NATS4 custom errors.php"

From TMM Wiki
Jump to navigationJump to search
m
Line 3: Line 3:
 
}}
 
}}
  
[[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 [[Ct#Program Owner|program owner]] and [[Ct#Admin (Person,NATS)]]. [[NATS4]] now offers customization of NATS's error handling and error messages through ''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 [[Ct#Program Owner|program owner]] and [[Ct#Admin|admin]]. [[NATS4]] now offers customization of NATS's error handling and error messages through ''custom_errors.php''
  
 
== custom_errors.php ==
 
== custom_errors.php ==

Revision as of 12:46, 26 July 2010

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 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.