I am still relatively new to PHP, and I'm trying to see if I can do some of the same sort of things in PHP that I can do in ColdFusion.
I want to filter all incoming data before I do anything with it. So I have included this bit of code at the top of the script:
// make all passed parameters local
foreach ($_REQUEST as $key => $val) {
$$key = trim(htmlentities(strip_tags($val) , ENT_QUOTES));
}
My question is: Is there a better way to filter incoming data? Should I be filtering out anything else? Is this a bad way to do it? Why?
Thanks!