Re: Escape problems...why?
| From: | Marek Kilimajer | Date: | Fri, 23 Apr 2004 09:14:31 +0000 |
| Subject: | Re: Escape problems...why? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184368@lists.php.net to get a copy of this message | ||
Ryan A wrote:
Hey John, Thanks for replying. I cant use strip slashes because there are a number of scripts doing DB things and searching for all of them and modifying things just for one client can be a royal PITA. I tried to use "php_flag magic_quotes_gpc off" in the *existing* .htaccess file like so: php_flag magic_quotes_gpc offTry the above line alone. If you are still getting 500 error you have to loop $_GET, $_POST ...., arrays and stripslash each element, unless the element is also an array, in this case you have to loop this one too: function strip_slashes_array($var) { if(!is_array($var)) return stripslashes($array); foreach($var as $key => $value) { $var[$key] = strip_slashes_array($value); } return $var; } $_POST = strip_slashes_array($_POST); HTH