mysql_escape_string(strip_tags($arr))

/**
* 函数名称:post_check() 
* 函数作用:对提交的编辑内容进行处理 
* 参  数:$post: 要提交的内容 
* 返 回 值:$post: 返回过滤后的内容 
*/
function post_check($post){
  if(!get_magic_quotes_gpc()){// 判断magic_quotes_gpc是否为打开 
    // 进行magic_quotes_gpc没有打开的情况对提交数据的过滤 
    $post = addslashes($post);
  }
  $post = str_replace("_","\_",$post);// 把 '_'过滤掉
  $post = str_replace("%","\%",$post);// 把 '%'过滤掉
  $post = nl2br($post);// 回车转换 
  $post =htmlspecialchars($post);// html标记转换 
  return $post;
}    

  

相关文章:

  • 2022-01-14
  • 2021-09-22
  • 2022-02-23
  • 2021-05-23
  • 2022-12-23
  • 2021-12-26
  • 2022-01-01
  • 2021-05-30
猜你喜欢
  • 2021-10-01
  • 2021-08-08
  • 2022-01-20
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案