class funcs
{
private static $cevap = "";
public static $url = "http://trgreencard.com/";
public static function resimYukle($name,$tmp,$target){
$name=trcevir($name);
$target_dir = $target;
$baskimsi = microtime().$name;
self::$cevap = $baskimsi;
$target_file = $target_dir . $baskimsi;
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
$check = getimagesize($tmp);
if($check !== false) {
$uploadOk = 1;
} else {
self::$cevap = "Sadece Resim Dosyalarına İzin Verilmektedir.";
$uploadOk = 0;
return false;
}
if ($uploadOk == 0) {
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($tmp, $target_file)) {
return true;
} else {
self::$cevap = "İşlem Sırasında Hata Oluştu...";
return false;
}
}
}
public static function trcevir ($text) {
$eng = array ('i','I','s','ç','g','Ç','G','ö','Ö','ü','Ü','S',' ');
$tr = array ('i','I','s','c','g','C','G','o','O','u','U','S',' ');
$text = str_replace($eng, $tr,$text);
return $text;
} PHP Resim Yüklerken TR Karakter Hatası
21
●663
- 15-03-2018, 20:10:43Aramızdan Ayrılanlar - Vefat Edenler
- 15-03-2018, 20:13:15Site çalışmıyor bu seferhicmiyok adlı üyeden alıntı: mesajı görüntüle
- 15-03-2018, 20:14:06fonksiyon class ın içinde olacak.CanibrahimTR adlı üyeden alıntı: mesajı görüntüle
- 15-03-2018, 20:16:09Denedim bu sefer resim yüklemiyorhicmiyok adlı üyeden alıntı: mesajı görüntüle
- 15-03-2018, 20:16:51
class funcs { private static $cevap = ""; public static $url = "http://trgreencard.com/"; public static function resimYukle($name,$tmp,$target){ $eng = array ('i','I','s','ç','g','Ç','G','ö','Ö','ü','Ü','S',' '); $tr = array ('i','I','s','c','g','C','G','o','O','u','U','S',' '); $name= str_replace($eng, $tr,$name); $target_dir = $target; $baskimsi = microtime().$name; self::$cevap = $baskimsi; $target_file = $target_dir . $baskimsi; $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); $check = getimagesize($tmp); if($check !== false) { $uploadOk = 1; } else { self::$cevap = "Sadece Resim Dosyalarına İzin Verilmektedir."; $uploadOk = 0; return false; } if ($uploadOk == 0) { // if everything is ok, try to upload file } else { if (move_uploaded_file($tmp, $target_file)) { return true; } else { self::$cevap = "İşlem Sırasında Hata Oluştu..."; return false; } } } - 15-03-2018, 20:18:320.59470200 1521134232ÅüÄashhds test resım.jpghicmiyok adlı üyeden alıntı: mesajı görüntüle
şeklinde yüklüyor yine - 15-03-2018, 20:19:36$resName= htmlentities ($_FILES['resim']["name"]); yerine $resName= $_FILES['resim']["name"];CanibrahimTR adlı üyeden alıntı: mesajı görüntüle
- 15-03-2018, 20:22:09hala aynıhicmiyok adlı üyeden alıntı: mesajı görüntüle
deliricem az kaldı
- 15-03-2018, 20:24:28https://www.erbilen.net/php-sef-link-fonksiyonu/ + verot upload sınıfını kullanın.