Ad 468 X 60

Tuesday, 1 April 2014

Widgets

Turn off Magic Quotes while saveing or inserting data in mysql using Tiny MCE Editor or CK, FCK Editor

How To Turn off Magic Quotes while saveing or inserting data in mysql using Tiny MCE Editor or CK, FCK Editor   Hi Friends,This is my first post on Dark PHP Blog.Now come to the point. it happens sometime when we use text editor like CK Editor,Tiny MCE etc , these editor sometime add some Magic quotes. For this reason we are not get desire result from text editor. The reason behind on this "Magic Quote".To stop this irritating problem. we have to turn off Magic Quote. Now just Copy and Paste this code on top the page between PHP Code Tag "<?php ?>"
 if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach ($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}
 

SHARE THIS POST   

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg
  • Technorati

0 comments: