<?php
mysql_connect('localhost', 'k.a', 'sifre')or die("hoppss bisiler ter giris bilgilerini kontrol et");
mysql_select_db('zulfumeh_mail')or die('Veritabanı nerdeki');

?>
<html lang="tr">
<head>
<meta charset="utf-8">
<title>Deneme</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
</head>
<body>

<?php
 
$gelen_kod=$_GET["id"];
 

if( isset( $_POST[ 'submit' ] ) !== false )
{
 include('class.upload.php');
    
$files = array();
foreach ($_FILES['image'] as $k => $l) {
  foreach ($l as $i => $v) {
    if (!array_key_exists($i, $files))
      $files[$i] = array();
    $files[$i][$k] = $v;
  }
}

// create an array here to hold file names
$uploaded = array();

foreach ($files as $file) {
  $handle = new Upload($file);
  if ($handle->uploaded) {
    // create a little array for this set of pictures
    $this_upload = array();
      
    $handle->file_name_body_add = '_thumbnial';
    $handle->file_auto_rename   = true;
    $handle->image_resize       = true;
    $handle->image_x            = 100;
    $handle->image_ratio_y      = true;
    $handle->Process('files/'.$_GET["id"].'/kucuk');
    
    if ($handle->processed) {
      echo $handle->file_dst_name;
      // store the large image filename  
      $this_upload['large'] = $handle->file_dst_name;
    } else {
      echo 'error : ' . $handle->error;
    }
    
    $handle->file_auto_rename   = true;
    $handle->image_resize       = false;
    $handle->image_x            = 100;
    $handle->image_ratio_y      = true;
    $handle->Process('files/'.$_GET["id"].'/');
    
    if ($handle->processed) {
      echo $handle->file_dst_name;
      // store the small image filename  
      $this_upload['small'] = $handle->file_dst_name;
      $handle->clean();
    } else {
      echo 'error : ' . $handle->error;
    }
    
    // add this set of pictures to the main array
    $uploaded[] = $this_upload;
  }
}
// now, you have all your picture names in $uploaded
// do your database insert like this for instance
$sql = "INSERT INTO resimler (fotoid, resim_adi, kucuk...) ";
$sql .= "VALUES ('$id', '".$uploaded[1]['resim_adi']."', '".$uploaded[1]['kucuk']."'))";
$x = mysql_query($sql);

}

?>
</body>
</html>