인터넷정보

get_magic_quotes_gpc()

알 수 없는 사용자 2007. 10. 16. 16:27

if ( !get_magic_quotes_gpc() ) {
 #$comment = stripslashes($comment);
 #$subject = stripslashes($subject);
} else {
 $comment = stripslashes($comment);
 $subject = stripslashes($subject);
}


if ( ! get_magic_quotes_gpc() ) {
 $comment = addslashes($comment);
 $subject = addslashes($subject);
} else {
}






================================

http://man.phpschool.com/manual/en/function.get-magic-quotes-gpc.php



<?php
if (get_magic_quotes_gpc
()) {
   function
maybeaddslashes(&$inthing
) { }
   function
maybestripslashes(&$inthing
) {
       if (
is_array($inthing
)) {
           foreach (
$inthing as $element
) {
              
$element = stripslashes($element
);
           }
       } else {
          
$inthing = stripslashes($inthing
);
       }
   }
} else {
   function
maybeaddslashes(&$inthing
) {
       if (
is_array($inthing
)) {
           foreach (
$inthing as $element
) {
              
$element = addslashes($element
);
           }
       } else {
          
$inthing = addslashes($inthing
);
       }
   }
   function
maybestripslashes(&$inthing
) {}
}
?>


반응형