分享

处理内容

 丶平上 2016-12-30
  1. /** 
  2. * 函数名称:post_check()  
  3. * 函数作用:对提交的编辑内容进行处理  
  4. * 参  数:$post: 要提交的内容  
  5. * 返 回 值:$post: 返回过滤后的内容  
  6. */  
  7. function post_check($post){  
  8. if(!get_magic_quotes_gpc()){// 判断magic_quotes_gpc是否为打开   
  9. $post = addslashes($post);// 进行magic_quotes_gpc没有打开的情况对提交数据的过滤   
  10. }  
  11. $post = str_replace("_","\_"$post);// 把 '_'过滤掉  
  12. $post = str_replace("%","\%"$post);// 把 '%'过滤掉  
  13. $post = nl2br($post);// 回车转换   
  14. $post = htmlspecialchars($post);// html标记转换   
  15. return $post;  
  16. }

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多