mandza
February 11th, 2012, 09:34 AM
Hi,
i have problem with uploading files and i dont know where the problem is, becouse of that i dont know what to search.
this is my code.
--------------------------------------
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />
<link media=\"all\" href=\"dizayn.css\" type=\"text/css\" rel=\"stylesheet\" />
<title>Pemax - Dosya Yükleme</title>
</head>
<body>
<form action=\"teknikservis_dosyaekle.php\" enctype=\"multipart/form-data\" method=\"post\">
<input type=\"hidden\" name=\"cihaz\" value=\"".$cihaz."\" />
<input type=\"hidden\" name=\"musteri\" value=\"".$musteri."\" />
<input type=\"file\" name=\"file\" /><br />
<input type=\"submit\" name=\"submit\" value=\"Dosya Ekle\" />
</form>
</body>
</html>
---------------------------------------------
---------------------------------------------
$cihaz=$_POST[cihaz];
$musteri=$_POST[musteri];
$dosyaismi=explode(".", $_FILES['file']['name']);
$boyut=$_FILES['file']['size'];
$uzanti=end($dosyaismi);
echo "$boyut - $uzanti - $cihaz - $musteri -";
/* i put echo just to see if there is information sended, but there is no any output.
i dont know is this problem with server or what.
this was working before.*/
//Eger cihaz bos degilse ve dosyanın uzantısı rar ise dosya yüklemeye başla
if(($uzanti=="rar" OR $uzanti=="zip") AND $cihaz!="" AND $musteri!="") {
$sondos=mysql_query("SELECT * FROM teknikservis_dosya WHERE 1 ORDER BY id DESC");
$sondosl=mysql_fetch_array($sondos);
$isim=($sondosl[id]+1);
$isims="drvr".$isim.".".$uzanti;
$time=time();
move_uploaded_file($_FILES["file"]["tmp_name"], "dosya/drvr" . $isim . ".$uzanti");
$vtekle=mysql_query("INSERT INTO teknikservis_dosya(dosya, musteri, cihaz, tarih, boyut, uzanti) VALUES('$isims', '$musteri', '$cihaz', '$time', '$boyut', '$uzanti')");
echo "<center>Dosya kaydedildi.<br />
<a href=\"javascript:void(0)\" onClick=\"javascript:self.close()\"><b>Pencereyi Kapat</b></a></center>";
} else {
echo "Dosya yuklerken hatta meydana geldi.";
}
-----------------------------------
i have problem with uploading files and i dont know where the problem is, becouse of that i dont know what to search.
this is my code.
--------------------------------------
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />
<link media=\"all\" href=\"dizayn.css\" type=\"text/css\" rel=\"stylesheet\" />
<title>Pemax - Dosya Yükleme</title>
</head>
<body>
<form action=\"teknikservis_dosyaekle.php\" enctype=\"multipart/form-data\" method=\"post\">
<input type=\"hidden\" name=\"cihaz\" value=\"".$cihaz."\" />
<input type=\"hidden\" name=\"musteri\" value=\"".$musteri."\" />
<input type=\"file\" name=\"file\" /><br />
<input type=\"submit\" name=\"submit\" value=\"Dosya Ekle\" />
</form>
</body>
</html>
---------------------------------------------
---------------------------------------------
$cihaz=$_POST[cihaz];
$musteri=$_POST[musteri];
$dosyaismi=explode(".", $_FILES['file']['name']);
$boyut=$_FILES['file']['size'];
$uzanti=end($dosyaismi);
echo "$boyut - $uzanti - $cihaz - $musteri -";
/* i put echo just to see if there is information sended, but there is no any output.
i dont know is this problem with server or what.
this was working before.*/
//Eger cihaz bos degilse ve dosyanın uzantısı rar ise dosya yüklemeye başla
if(($uzanti=="rar" OR $uzanti=="zip") AND $cihaz!="" AND $musteri!="") {
$sondos=mysql_query("SELECT * FROM teknikservis_dosya WHERE 1 ORDER BY id DESC");
$sondosl=mysql_fetch_array($sondos);
$isim=($sondosl[id]+1);
$isims="drvr".$isim.".".$uzanti;
$time=time();
move_uploaded_file($_FILES["file"]["tmp_name"], "dosya/drvr" . $isim . ".$uzanti");
$vtekle=mysql_query("INSERT INTO teknikservis_dosya(dosya, musteri, cihaz, tarih, boyut, uzanti) VALUES('$isims', '$musteri', '$cihaz', '$time', '$boyut', '$uzanti')");
echo "<center>Dosya kaydedildi.<br />
<a href=\"javascript:void(0)\" onClick=\"javascript:self.close()\"><b>Pencereyi Kapat</b></a></center>";
} else {
echo "Dosya yuklerken hatta meydana geldi.";
}
-----------------------------------