zoukankan      html  css  js  c++  java
  • PHP 传参过滤

    <?php

    class class_replace{

    function htmldecode($str){

    if(empty($str)) return;if($str=="") return $str;

    $str=str_replace("&","",$str);

    $str=str_replace(">","",$str);

    $str=str_replace("<","",$str);

    $str=str_replace("chr(32)","",$str);

    $str=str_replace("chr(9)","",$str);

    $str=str_replace(chr(34),"",$str);

    $str=str_replace("\"","",$str);

    $str=str_replace(chr(39),"",$str);

    $str=str_replace("","",$str);

    $str=str_replace("'","",$str);

    $str=str_replace("select","",$str);

    $str=str_replace("join","",$str);

    $str=str_replace("union","",$str);

    $str=str_replace("where","",$str);

    $str=str_replace("insert","",$str);

    $str=str_replace("delete","",$str);

    $str=str_replace("update","",$str);

    $str=str_replace("like","",$str);

    $str=str_replace("drop","",$str);

    $str=str_replace("create","",$str);

    $str=str_replace("modify","",$str);

    $str=str_replace("rename","",$str);

    $str=str_replace("alter","",$str);

    $str=str_replace("cas","",$str);

    $str=str_replace("replace","",$str);

    $str=str_replace("%","",$str);

    $str=str_replace("or","",$str);

    $str=str_replace("and","",$str);

    $str=str_replace("!","",$str);

    $str=str_replace("xor","",$str);

    $str=str_replace("not","",$str);

    $str=str_replace("user","",$str);

    $str=str_replace("||","",$str);

    $str=str_replace("<","",$str);

    $str=str_replace(">","",$str);

    return $str;

    }

    }

    //使用方法:$guolv=new class_replace();

    //实例化

    //$username=$guolv->htmldecode($_POST["username"]);

    //使用例子?>

  • 相关阅读:
    按次计费简单实现思路
    java读取和写入excel
    SpringBoot定时任务自动停止关闭
    class path resource [applicationContext.xml] cannot be opened because it does not exist
    Tomcat安装配置idea
    Git rebase
    MongoDB高可用集群配置方案
    keepalived主从及双主配置
    openssl 生成免费证书
    Nginx proxy_cache 缓存静态文件
  • 原文地址:https://www.cnblogs.com/wangjiangze/p/2055216.html
Copyright © 2011-2022 走看看