<?
        # $userf = $file;
		$userfk = $_FILES['filebildk']['tmp_name'];
        $fnamek = $HTTP_POST_FILES['filebildk']['name'];
		$userfg = $_FILES['filebildg']['tmp_name'];
        $fnameg = $HTTP_POST_FILES['filebildg']['name'];

echo "fnamek".$userfk;
   if($fnamek!=""){
 
        $fp = fopen ($userfk, "rb");
		$fileSize = $_FILES['filebildk']['size'];
#        $fileSize = filesize($userf);
        $contents = fread($fp,$fileSize);
        fclose($fp);
        if ($fileSize<5000000){
              
                $directory="../bilder/galerien/bildk";
               
	        $fnamek=eregi_replace(" ","-",$fnamek);  
	        $fnamek=eregi_replace("Ü","Ue",$fnamek);  
	        $fnamek=eregi_replace("ü","ue",$fnamek);  
	        $fnamek=eregi_replace("Ä","Ae",$fnamek);  
	        $fnamek=eregi_replace("ä","ae",$fnamek);  
	        $fnamek=eregi_replace("ö","oe",$fnamek);  
	        $fnamek=eregi_replace("Ö","Oe",$fnamek);  
		
	        $fnamek=$last_id."_".$fnamek; 
                $fp = fopen("$directory/$fnamek","wb");
                fwrite($fp, $contents);
        } else {
                echo "<hr> Die Datei $fnamek ist zu groß!!!<hr>";
				
        }
        fclose($fp);
$destination ="$directory/$fnamek";
}
   if($fnameg!=""){
   $img_array = GetImageSize($userf1);
   
        $fp = fopen ($userfg, "rb");
		$fileSize1 = $_FILES['filebildg']['size'];
#        $fileSize = filesize($userf);
        $contents1 = fread($fp,$fileSize1);
        fclose($fp);
        if ($fileSize1<5000000  && $img_array[0]<= "2000"){
              
               /* $directory1="/usr/local/www/intranet.zvw.de/pages/dateien/neues/dateienbild";*/
                $directory1="../bilder/galerien/bildg";
	        $fnameg=eregi_replace(" ","-",$fnameg);  
	        $fnameg=eregi_replace("Ü","Ue",$fnameg);  
	        $fnameg=eregi_replace("ü","ue",$fnameg);  
	        $fnameg=eregi_replace("Ä","Ae",$fnameg);  
	        $fnameg=eregi_replace("ä","ae",$fnameg);  
	        $fnameg=eregi_replace("ö","oe",$fnameg);  
	        $fnameg=eregi_replace("Ö","Oe",$fnameg);  
		
	        $fnameg=$last_id."_".$fnameg; 
                $fp = fopen("$directory1/$fnameg","wb");
                fwrite($fp, $contents1);
				fclose($fp);
        } else {
                echo "<hr> Die Datei $fnameg darf nicht größer als 5 MB sein  und eine Breite von 2000 px nicht über schreiten !!!<hr>";
				/* include("../verwaltung/neues/verwaltung/endedateigross.php");*/
				
        }
        
$destination1 ="$directory1/$fname1";


 
/*$img_array = GetImageSize($destination);

if($img_array[2]== "1"){ $type = ".gif"; }
if($img_array[2]== "2"){ $type = ".jpg"; }
if($img_array[2]== "3"){ $type = ".png"; }
if($img_array[2]== "4"){ $type = ".swf"; }
$X_0=$img_array[0];
$Y_0=$img_array[1];
$type_0=$type;*/     
}          
?>