Jump to content


Photo

echoing all vars


  • Please log in to reply
1 reply to this topic

#1 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 15 June 2006 - 08:02 AM

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?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 15 June 2006 - 08:15 AM

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!

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users