My server has magicquotes enabled (cannot disable it). I need to remove the slashes before inserting the value into the database. How would I do this? (How would I use stripslashes() with editor?)
There are a number of ways you could do this. Possibly the best option (other than turning magic quotes off - baring in mind that they are been completely removed in v5.4 :-) ) is to use this in your .htaccess file (assuming that you are using Apache):
[code]
php_flag magic_quotes_gpc off
[/code]
Otherwise you could use something like this at the very top of the file:
Replies
[code]
php_flag magic_quotes_gpc off
[/code]
Otherwise you could use something like this at the very top of the file:
[code]
if (get_magic_quotes_gpc()) {
function stripslashes_gpc(&$value)
{
$value = stripslashes($value);
}
array_walk_recursive($_GET, 'stripslashes_gpc');
array_walk_recursive($_POST, 'stripslashes_gpc');
array_walk_recursive($_COOKIE, 'stripslashes_gpc');
array_walk_recursive($_REQUEST, 'stripslashes_gpc');
}
[/code]
Regards,
Allan