post and get 检查非法参数
来源:互联网 发布:苹果最新系统下载软件 编辑:程序博客网 时间:2024/06/08 04:15
//是否存在数组中的值
function FunStringExist($StrFiltrate,$ArrFiltrate){
foreach ($ArrFiltrate as $key=>$value){
if (preg_match("/".$value."/",$StrFiltrate)){
return true;
}
}
return false;
}
//验证开始
function str_check($ArrFiltrate=array()){
if(!isset($ArrFiltrate)){
$ArrFiltrate = array();
}
//合并$_POST 和 $_GET
$ArrPostAndGet = array();
foreach($_POST as $key=>$value){
$ArrPostAndGet[]=$value;
}
foreach($_GET as $key=>$value){
$ArrPostAndGet[]=$value;
}
foreach($ArrPostAndGet as $key=>$value){
if (FunStringExist($value,$ArrFiltrate)){
return false;
}else{
continue;
}
}
return true;
function FunStringExist($StrFiltrate,$ArrFiltrate){
foreach ($ArrFiltrate as $key=>$value){
if (preg_match("/".$value."/",$StrFiltrate)){
return true;
}
}
return false;
}
//验证开始
function str_check($ArrFiltrate=array()){
if(!isset($ArrFiltrate)){
$ArrFiltrate = array();
}
//合并$_POST 和 $_GET
$ArrPostAndGet = array();
foreach($_POST as $key=>$value){
$ArrPostAndGet[]=$value;
}
foreach($_GET as $key=>$value){
$ArrPostAndGet[]=$value;
}
foreach($ArrPostAndGet as $key=>$value){
if (FunStringExist($value,$ArrFiltrate)){
return false;
}else{
continue;
}
}
return true;
}
$ArrFiltrate=array("eval",";","'","\"","<",">","union");
if(!str_check($ArrFiltrate)){
echo make_json_app_response('1','存在非法参数');
exit;
}
0 0
- post and get 检查非法参数
- Get and Post
- Get and Post
- post and get
- curl post and get
- GET and POST
- get-post and doGet-doPost
- c# POST And Get提交
- Android HttpClientConnection Get and Post
- apache Httpclient GET and POST
- get,and Post请求区别
- $.ajax,$.post,$.get参数详解
- 通过post get 传递参数。
- java获取get,post参数
- 检查非法字符
- 内核非法MAC检查
- EXAMPLE of parsing GET and POST
- python学习之--Django--Get and Post
- HDU 1021 Fibonacci Again
- tomcat监听器ServletContextListener加载web应用数据
- BZOJ1861——book
- java程序中对堆栈的理解
- 发短信/邮件/打电话
- post and get 检查非法参数
- java基础(12)-- 深入理解Collections.sort()
- android线程通信之Asynctask
- poj 1556 The Doors(线段交+最短路)
- Swift开发参考书籍
- [百度实习生]缺页问题
- 常见移动设备的 CSS3 Media Query 整理(iPhone/iPad/Galaxy/HTC One etc.)
- address元素
- 直插排序