note 32451 added to reserved.variables

From: Date: Wed, 28 May 2003 06:20:51 +0000
Subject: note 32451 added to reserved.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-49152@lists.php.net to get a copy of this message
Here's how to get all the global variables to print out for any called page with extremely little effort (10 min time max). First - a big note of thanks to dakota for the script enumerating and exposing variables (see above). 1) modify dakota's script so it is called when ?debug=1 is added to the url if ($debug==1) { view_values($GLOBALS); } optional : change the color coding to the following: "FFFFC0" : "C0C0FF" - dakota's colors don't show in IE very well. 2) save dakota's script in a file called debug.php. 3) add an auto_prepend_file directive to your php.ini (or .htaccess) file so php will automatically add this script to every requested php script . ----php.ini--- auto_prepend_file ="e:/home/public_html/debug.php" ---or .htaccess ---- php_value auto_prepend_file "e:/home/public_html/debug.php" ----- 4) security warning !! be sure to comment out the autoprepend directive when you go into production - don't want every cracker in the neighborhood exposing your site with a ?debug=1 call 5) the same thing can be achieved with if ($debug==1) { phpinfo(); } but IMHO dakota's script is more flexible and the layout is better cheers ! ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32451 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32451&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32451&report=yes

« previous php.notes (#49152) next »