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;
}