Admin = $Admin; if(function_exists(ini_set)) ini_set("display_errors","off"); $this -> MYSQL_database = $db; $this -> MYSQL_user = $user; $this -> MYSQL_passwd = $passwd; $this -> MYSQL_host = $host; $this -> MYSQL_charset = $charset; global $_POST,$_GET; if(!empty($_POST) && !$Admin){ foreach ($_POST AS $nev => $tartalom){ if(ereg("'",$tartalom)){ $this -> ErrorLog("Tiltott karakter a POSTBAN:".$tartalom); $_POST[$nev] = str_replace("'","#####",$_POST[$nev]); } } } if(!empty($_GET)){ if (ereg("[./]",$_SERVER['QUERY_STRING']) && !$Admin) { $this -> ErrorLog(". az url-ben: ".$_SERVER['QUERY_STRING']); unset($_GET); } } } function escape_string($s){ return mysql_real_escape_string($s); } function query($query){ $DB = mysql_connect($this -> MYSQL_host,$this -> MYSQL_user,$this -> MYSQL_passwd); // echo $query."
"; @mysql_select_db($this -> MYSQL_database,$DB) or die ("Nem lehet megnyitni a(z) $this->MYSQL_database -t:".mysql_error()); @mysql_query("SET NAMES '".$this -> MYSQL_charset."'",$DB); //@mysql_query("SET CHARACTER SET '".$this -> MYSQL_charset."'",$DB); $vissza = @mysql_query($query,$DB); $error = mysql_error(); if(mysql_insert_id()!=0) $this -> MYSQL_iid = mysql_insert_id(); mysql_close($DB); // if(!$vissza){ $this -> ErrorLog($error); if(!$this -> Admin){ // echo ""; } else echo "".$error.""; // exit(); } return $vissza; } function fetch($sql){ return @mysql_fetch_array($this->query($sql." LIMIT 0,1")); } function menu($ID,$Cim='cim',$Field='szoveg',$Table='menu',$Key='id'){ $sor = $this -> fetch("SELECT ".$Field.",".$Cim." FROM ".$Table." WHERE `".$Key."`='$ID'"); $this->cim = $sor[$Cim]; $this->szoveg = $sor[$Field]; } function TablaMod($_POST,$table,$id,$azon='id'){ $query="UPDATE $table SET "; foreach ($_POST AS $nev => $tartalom){ if($nev!='mod' && $nev!=$azon){ if($x!=NULL) $query.=","; $query.=" `$nev`='$tartalom' "; $x++; } } $query.=" WHERE $azon=$id"; $this -> query($query); // echo $query."

 

"; } function TablaAdd($_POST_,$table){ $x=0; $query="INSERT INTO $table ("; foreach ($_POST_ AS $nev => $tartalom){ if($nev!='add'){ if($x>0){ $query.=","; $value.=","; } $query.="`$nev`"; $value.="'$tartalom'"; $x++; } } $query.=" ) VALUES (".$value.")"; $this -> query($query); //echo $query; } function kit($file) { $darab=explode(".",$file); $v=count($darab)-1; return $darab[$v]; } function ErrorLog($error){ //$DB = mysql_connect($this -> MYSQL_host,"sqlerror",'gds0255'); //@mysql_select_db("sqlErrorLog",$DB); //@mysql_query("SET NAMES 'latin2'",$DB); //@mysql_query("SET CHARACTER SET 'latin2'",$DB); echo "Hiba: $error, itt: ".$_SERVER['PHP_SELF'];return true; @mysql_query("INSERT INTO `ErrorLog` (`query`,`ip`,`link`,`datum`,`sql_user`) VALUES ('".ereg_replace("'","\'",$error)."','".$_SERVER['REMOTE_ADDR']."','".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."',NOW(),'".$this->MYSQL_database."')",$DB); @mysql_close($DB); } function QueryStringGentelo($get,$value){ $query_string = $_SERVER['QUERY_STRING']; if(ereg($get,$query_string)){ $hekma = explode($get,$query_string); $hekm = explode("&",$hekma[1]); $hekma = null; for ($x=1;$x fetch("SELECT ".$cim.",id,szulo FROM `".$table."` WHERE id=".$id); if($menu['szulo']!=null){ $link = $this -> Menulista($menu['szulo'],$cim,$table)." » ".$menu[$cim].""; } return $link; } } ?>