utilINC.php stores site-wide utility functions
Stores functions like myerror(), which handles MySQL and other or die() errors, myRedirect() to direct users away from pages and dbOut() which cleans data coming from MySQL
Provides sitewide configuration info and error handling function
Provides database connection capability with conn() function
Wrapper function for processing data pulled from db
Forward slashes are added to MySQL data upon entry to prevent SQL errors. Using our dbOut() function allows us to encapsulate the most common functions for removing slashes with the PHP stripslashes() function, plus the trim() function to remove spaces.
Later, we can add to this function sitewide, as new requirements or vulnerabilities develop.
Prints a customized MySQL (or other die() based) error message
When 'or die()' is used, we use this function to customize the error message sent. The global var $HidePageErrors, if true, shows only a public error message, including a code for users to pass identifying the page and line number involved for the error.
Example: TLNCx41
The above would be the example for this file, plus an error at line 41 This allows a user to report an error that identifies it, without compromising site security
Forcibly passes user to a local URL. Requires ob_start(); at the top of including pages
PHP does not have a redirect to a local file. The PHP header() function requires an absolute URL, eliciting this workaround. Any page using myRedirect() needs ob_start() at the top of the page or header() errors will occur.
Error will say 'headers already sent', etc.
For completeness, ob_flush() should go at the bottom of the page using myRedirect().
Documentation generated on Sat, 03 May 2008 19:47:45 -0700 by phpDocumentor 1.4.1