Re: [PHP] Kill Magic Quotes

2008-08-08 Thread mike
On 8/8/08, Stephen <[EMAIL PROTECTED]> wrote: > I found this solution after a web search. I can't attribute the author, but > would like to if I could. I have something like that myself, but even on the URL they linked it has a "php.net approved" snippet of code that works: http://www.php.net/ma

Re: [PHP] Kill Magic Quotes

2008-08-08 Thread Stephen
Dave M G wrote: PHP List, I found this solution after a web search. I can't attribute the author, but would like to if I could. I have a routine like this: if (isset($_POST['choice'])) { if (get_magic_quotes_gpc() ){ stripslashes_arrays( $_POST ); } $choice = $_POST['choice']; } else { $cho

Re: [PHP] Kill Magic Quotes [SOLVED]

2008-08-07 Thread Dave M G
Richard, > Try php_value instead of php_flag, though both should work for this one. Whoops... my mistake. Without going into overly complicated details, I hadn't tested the original suggestion properly. Turns out, so far as I can tell, both of these lines work for me: php_value magic_quotes_g

Re: [PHP] Kill Magic Quotes

2008-08-07 Thread Dave M G
Richard, Thank you for replying. If you can't change php.ini, and if it's Apache, you maybe can just turn it off in .htaccess, far faster and easier than a PHP function. I looked on the web and found this line: php_flag magic_quotes_gpc off ... and added it to my .htaccess file. But it doesn'

Re: [PHP] Kill Magic Quotes

2008-08-07 Thread Chris
public static function restoreSlashes($string) { // Check if "Magic Quotes" is turned on. if (get_magic_quotes_gpc()) { // Add escape slashes. return addslashes($string); } // Return a string that has escape slashes. return $string; } Wrong way around. If gpc is enabled,

Re: [PHP] Kill Magic Quotes

2008-08-07 Thread Richard Lynch
If you can't change php.ini, and if it's Apache, you maybe can just turn it off in .htaccess, far faster and easier than a PHP function. You are calling the removeSlashes, right? And, really, there is no reason for the restoreSlashes function to exist. If you ever think you need it, you're wrong

[PHP] Kill Magic Quotes

2008-08-07 Thread Dave M G
PHP List, I am developing a web site that is hosted on a web server where I do not have permission to change the php.ini file. This server has magic quotes turned on. I'd like them off. I wrote two functions to detect when magic quotes is on, and to try and counter act its effects. But it do