Jump to content

Archived

This topic is now archived and is closed to further replies.

.josh

echoing all vars

Recommended Posts

okay, so i am making this function that sanitizes variables, and i thought i'd go the extra step and create another function to log potentially dangerous user input (as in, sql injection attempts, etc..).

so my error log is going to pretty much grab any information I can. I can do a foreach on $_SESSION $_POST $_GET and $_REQUEST, but I was wondering, in order to make this function as "all purpose" as possible, if I am able to somehow grab all the miscellaneous variables in play that are not included in those.

For instance, say I have the following variables in my script:

$x
$blah
$foobar

is there some sort of built in dumpvars() type of function that will access all of these at once, or am I going to have to manually build a string or array with everything in the particular page script in order to make this logging function as "all purpose" as possible?

Share this post


Link to post
Share on other sites
solved:

okay i found a very handy superglobal called $globals that will do exactly what i want and even cut out some of the legwork, woot!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.