<?php
session_start();
class girdi{
function girdi(){
if(get_magic_quotes_gpc()){
if(isset($_GET) && !isset($this->get)) $this->get = $this->temiz($_GET,false);
if(isset($_POST) && !isset($this->post)) $this->post = $this->temiz($_POST,false);
if(isset($_COOKIE) && !isset($this->cookie)) $this->cookie = $this->temiz($_COOKIE,false);
if(isset($_SESSION) && !isset($this->session)) $this->session = $this->temiz($_SESSION,false);
if(isset($_FILES) && !isset($this->files)) $this->files = $this->temiz($_FILES,false);
if(isset($_SERVER) && !isset($this->server)) $this->server = $this->temiz($_SERVER,false);
}else{
if(isset($_GET) && !isset($this->get)) $this->get = $this->temiz($_GET,true);
if(isset($_POST) && !isset($this->post)) $this->post = $this->temiz($_POST,true);
if(isset($_COOKIE) && !isset($this->cookie)) $this->cookie = $this->temiz($_COOKIE,true);
if(isset($_SESSION) && !isset($this->session)) $this->session = $this->temiz($_SESSION,true);
if(isset($_FILES) && !isset($this->files)) $this->files = $this->temiz($_FILES,true);
if(isset($_SERVER) && !isset($this->server)) $this->server = $this->temiz($_SERVER,false);
}
if(!isset($this->url)) $this->url = substr(@$this->server['PATH_INFO'],-1)!='/'? basename($this->server['SCRIPT_NAME']).@$this->server['PATH_INFO'].'/':basename($this->server['SCRIPT_NAME']).@$this->server['PATH_INFO'];
if(!isset($this->uri)) $this->uri=explode('/',substr(@$this->server['PATH_INFO'],-1)!='/' ? basename($this->server['SCRIPT_NAME']).@$this->server['PATH_INFO']:basename($this->server['SCRIPT_NAME']).substr(@$this->server['PATH_INFO'],0,-1));
}
function temiz($veri, $temiz = true){
$cikti=null;
if(is_array($veri)){
foreach($veri as $girdi=>$deger){
$cikti[$girdi] = $this->temiz($deger,$temiz);
}
return $cikti;
}elseif($temiz){
return addslashes($veri);
}else{
return $veri;
}
}
}
$girdi = new girdi();
print_r($girdi->get);
print_r($girdi->post);
print_r($girdi->session);
print_r($girdi->cookie);
print_r($girdi->files);
print_r($girdi->server);
?>