note 32451 deleted from reserved.variables by sniper
| From: | sniper@php.net | Date: | Tue, 21 Oct 2003 19:43:29 +0000 |
| Subject: | note 32451 deleted from reserved.variables by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59067@lists.php.net to get a copy of this message | ||
Note Submitter: gemini1@gemini1consulting.com
----
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 !