Merhaba Dropzone kullanmaktayım normal olarak fotoğraf yüklemesi yapıyorum hiç bir sorun yok ama fotoğraf yüklenirken de id göndermek istiyorum ancak bir türlü post işlemini yapamadım. Nerede hata yapıyorum?
Form alanım,
<form class="form" action="inc/galerie.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="user_id" value="<?php echo $user_id; ?>">
<!--begin::Input group-->
<div class="fv-row">
<!--begin::Dropzone-->
<div class="dropzone" id="kt_dropzonejs_example_1">
<!--begin::Message-->
<div class="dz-message needsclick">
<!--begin::Icon-->
<i class="bi bi-file-earmark-arrow-up text-primary fs-3x"></i>
<!--end::Icon-->
<!--begin::Info-->
<div class="ms-4">
<h3 class="fs-5 fw-bolder text-gray-900 mb-1">Seçin yada buraya sürükleyin.</h3>
<span class="fs-7 fw-bold text-gray-400">Aynı anda 10 dosyaya kadar yükleyebilirsiniz.</span>
</div>
<!--end::Info-->
</div>
</div>
<!--end::Dropzone-->
</div>
<!--end::Input group-->
</form>
<!--end::Form-->
Footer Script alanım
<script>
var myDropzone = new Dropzone("#kt_dropzonejs_example_1", {
url: "inc/galerie.php", // Set the url for your upload script location
type: "POST",
});
</script>
php işlem alanım
ob_start();
session_start();
include 'config.php';
require 'class.upload.php';
if($_FILES['file']!=""){
$upload = new \Verot\Upload\Upload($_FILES['file']);
if ($upload->uploaded){
$benzersizsayi=rand(100000,999999);
$upload->mime_check = false;
$upload->mime_file = false;
$upload->image_convert = 'png';
$upload->file_new_name_body = "$benzersizsayi-$dosyaisim";
$upload->image_resize = true;
$upload->image_ratio_crop = false;
$upload->image_x = 1000;
$upload->image_y = 1000;
$upload->image_text_color = '#000000';
$upload->process("resim/");
$hata=$upload->error;
if ($upload->processed){
$marka_logod="$benzersizsayi.png";
// ESKİ MARKA LOGOSU VARSA BİT
// resim yükleme başarılı ise
} else {
print 'Bir sorun oluştu: '.$upload->error;
}
$id= $_POST['user_id'];
$kaydet=$db->prepare("INSERT INTO gallery SET
image_way=:image_way,
user_id=:user_id
");
$insert=$kaydet->execute(array(
'image_way' => "resim/$marka_logod",
'user_id' => "$id"
));
}
}