In my prepend file, or at the top of an example file, I add the following lines of code.
/* start with debugging off */
$debug = 0;
/* an array containing a list of IPs that may view your data. */
$debug_ips = array('192.168.0.2');
/* make sure debugging is off to avoid it being set in the url */
$debug_ok = 0;
/* determine if it's ok to throw errors to the screen */
if ( $debug == 1 && in_array( $_SERVER['REMOTE_ADDR'], $debug_ips ) )
$debug_ok = 1;
The above snippet verifies that it's ok to send debugging information to the browser. We have two basic
requirements: the IP is in the $debug_ips array and debug is turned on (that is: $debug is set to '1').
By setting this early on and using a single variable, $debug_ok, throughout the site we can change the
requirements at any time and not have to edit anything other than this data.
If you'd like to add someone to your list of people allowed to see the data, just add their IP to the