/*************************
Description:
Determine whether the passed variable contains illegal characters
Such as $_post, $_get
Function:
Anti-injection
**************************/
//Illegal characters to be filtered This filtered character can also be added
$arrfiltrate=array("'",";","union");
//The URL to jump to after an error occurs. If not filled in, the previous page will be defaulted
$strgourl="";
//Whether there is a value in the array
function funstringexist($strfiltrate,$arrfiltrate){
foreach ($arrfiltrate as $key=>$value){
if (eregi($value,$strfiltrate)){
return true;
}
}
return false;
}//Merge $_post and $_get
if(function_exists(array_merge)){
$arrpostandget=array_merge($http_post_vars,$http_get_vars);
}else{
foreach($http_post_vars as $key=>$value){
$arrpostandget[]=$value;
}
foreach($http_get_vars as $key=>$value){
$arrpostandget[]=$value;
}
}//Verification starts
foreach($arrpostandget as $key=>$value){
if (funstringexist($value,$arrfiltrate)){
echo "";
if (empty($strgourl)){
echo "";
}else{
echo "";
}
exit;
}
}
?>