https://paste.ofcode.org/g9xrhxFjK4Fk5hFAYTppzL
<?php
include 'baglan.php';
?>
<form action="resimyukle.php" method="post" enctype="multipart/form-data">
<input type="file" name="resim"/>
<input type="text" name="aciklama"/>
<input type="submit" name="gonder" value="Kaydet"></form>
<?php
if (isset($_POST['gonder'])) {
$uploads_dir = '../../dimg';
@$tmp_name = $_FILES['resim']["tmp_name"];
@$name = $_FILES['resim']["name"];
$benzersizsayi1=rand(20000,32000);
$benzersizsayi2=rand(20000,32000);
$benzersizsayi3=rand(20000,32000);
$benzersizsayi4=rand(20000,32000);
$benzersizad=$benzersizsayi1.$benzersizsayi2.$benzersizsayi3.$benzersizsayi4;
$refimgyol=substr($uploads_dir, 6)."/".$benzersizad.$name;
@move_uploaded_file($tmp_name, $uploads_dir.'/'.$benzersizad.$name);
$kaydet=$db->prepare("INSERT INTO resim SET
aciklama=:aciklama,
resim=:resim
");
$insert=$kaydet->execute(array(
'aciklama' => $_POST['aciklama'],
'resim' => $refimgyol
));
if ($insert) {
Header("Location:../netting/resimyukle.php?durum=ok");
} else {
Header("Location:../netting/resimyukle.php?durum=no");
}
}
?>