i am not able to understand this problem When I sending a form , meeting with this problem Mistake... that, Help for this problem please. thank you Warning: Illegal offset type in c:\program files\easyphp1-8\www\dosyagonder2\yukle.php on line 20 Warning: Illegal offset type in c:\program files\easyphp1-8\www\dosyagonder2\yukle.php on line 21 please help index.html
$ufile = $_FILES["userfile"]; $upload_dir = "dosyalar/"; UpFile($ufile,$upload_dir); function UpFile($ufile,$upload_dir){ // dosya biçimleri $file_types = array('application/zip','text/plain','image/gif','image/jpeg','image/jpeg','image/png','application/x-tar','application/x-gzip','audio/mpeg','video/quicktime','application/msword','application/vnd.ms-excel','text/xml','video/x-msvideo','text/css','application/vnd.oasis.opendocument.presentation','application/vnd.oasis.opendocument.text','application/vnd.oasis.opendocument.spreadsheet','application/x-bittorrent','application/pdf','application/x-shockwave-flash','audio/x-wav'); // dosya uzantıları $file_exts = array('.zip','.txt','.gif','jpeg','.jpg','.png','tar','.gz','.mp3'.'.mov','.doc','.xls','.xml','.avi','.css','.odp','.odt','.ods','.torrent','.pdf','.swf','.wav'); // upload dizini yoksa if (!is_dir($upload_dir)) { return 4; } $file_name = $_FILES[$ufile]['name']; // gönderilen dosyanın adı $file_type = $_FILES[$ufile]['type']; // gönderilen dosyanın tipi $file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); // dosyauzantısını alalım if (!empty($file_name) && !empty($file_type)) { // dosya adı ve tipi boş değilse if (!in_array($file_type, $file_types) && !in_array($file_ext, $file_exts)) { // dosya tipleri ve dosya uzantısı birbirine uygun mu ? return 6; } else { // upload file $tempname = $_FILES[$ufile]['tmp_name']; // dosyanın geçici adresi $file_name = str_replace("\\","",$file_name); // $file_name = str_replace("'","",$file_name); // $file_path = $upload_dir.md5(time())."_".$file_name; // dosyanın yeni adresi // dosyanın yüklenmiş olduğunu kontrol edelim, if(is_uploaded_file($tempname)){ // dosya yüklenmiş ise if(!move_uploaded_file($tempname,$file_path)){ // dosya taşınamaz ise return 7; } else { if(!chmod($file_path, 0755)){ // dosya izinleri verilemedi return 8; } else { // dosya yüklendi ve kullanıma hazır return $file_path; } } } else { // dosya yükleme ile ilgili bir sorun var, bu bir saldırı olabilir return 9; } } } else { // içerik boş return 5; } } ?>