您好,欢迎访问一九零五行业门户网

Get或Post提交值的非法数据处理_PHP教程

get或post提交值的非法数据处理subgetstrtoarray();
}
if(post==$request_method){
$this->subpoststrtoarray();
}
$this->globalvariable();
}
//********************************************************
//-- 程序名称:subgetstrtoarray()
//-- 程序用途:当变量以get方式提交时所调用的方法
//-- 传入参数:无
//********************************************************
function subgetstrtoarray(){
global $query_string;
$this->temparray = explode($this->getsplitstr,$query_string);
for($i=0;$itemparray);$i++){
$temp = explode('=',$this->temparray[$i]);
$this->variablearray[$i][0] = $temp[0];
$this->variablearray[$i][1] = $this->strreplace($temp[1]);
}
}
//********************************************************
//-- 程序名称:subpoststrtoarray()
//-- 程序用途:当变量以post方式提交时所调用的方法
//-- 传入参数:无
//********************************************************
function subpoststrtoarray(){
global $_post;
reset($_post);
for($i=0;$i
$this->variablearray[$i][0] = key($_post);
$this->variablearray[$i][1] = $this->strreplace($_post[key($_post)]);
next($_post);
}
}
//********************************************************
//-- 程序名称:strreplace()
//-- 程序用途:替换变量中的非法字符
//-- 传入参数:变量值
//********************************************************
function strreplace($str){
$str = stripslashes($str);
$str = str_replace(chr(92),'',$str);
$str = str_replace(chr(47),'',$str);
$str = str_replace(chr(10).chr(13),
,$str);
$str = str_replace('$str = str_replace('>',>,$str);
$str = str_replace(';',;,$str);
$str = str_replace('',“,$str);
$str = str_replace(',‘,$str);
$str = str_replace( , ,$str);
$str = str_replace(/**/, ,$str);
return trim($str);
}
//********************************************************
//-- 程序名称:globalvariable()
//-- 程序用途:声明变量为全局变量方便其他程序调用
//-- 传入参数:无
//********************************************************
function globalvariable(){
for($i=0;$ivariablearray);$i++){
global $$this->variablearray[$i][0];
${$this->variablearray[$i][0]} = $this->variablearray[$i][1];
}
}
}
?>
http://www.bkjia.com/phpjc/314654.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/314654.htmltecharticleget或post提交值的非法数据处理?php //******************************************************** //-- 程序名称:strswap v1.01 //-- 程序编写:[email]cngift@163.com[...
其它类似信息

推荐信息