<?php 
if(is_array($_GET)){
	foreach($_GET AS $key => $value){
		if(!isset(${$key})) ${$key} = addslashes($value);
	}
}

if(is_array($_POST))
{
		foreach($_POST AS $key => $value)
		{
			if(!isset(${$key}))
			{
				if(is_array($value)){
	    	   foreach($value as $nnk=>$nnv){
	    	   	 ${$key}[$nnk] = addslashes($nnv);
	    	   }
	      }else{
	      	 ${$key} = addslashes($value);
	      }
			}
		}
}

if(is_array($_COOKIE)){ foreach($_COOKIE AS $key => $value) if(!isset(${$key})) ${$key} = addslashes($value); }

if (is_array($_FILES)) {
  foreach($_FILES AS $name => $value){
     if(!isset(${$name})) ${$name} = $value['tmp_name'];
     foreach($value AS $namen => $valuen){ if(!isset(${$name.'_'.$namen})) ${$name.'_'.$namen} = $valuen; }
  }
}
?>