All pastes #261857 Raw Edit

Stuff

public php v1 · immutable
#261857 ·published 2006-11-29 22:28 UTC
rendered paste body
i am not able to understand this problemWhen I sending  a form , meeting with this problemMistake... that, Help for this problem please.thank youWarning: Illegal offset type in c:\program files\easyphp1-8\www\dosyagonder2\yukle.php on line 20Warning: Illegal offset type in c:\program files\easyphp1-8\www\dosyagonder2\yukle.php on line 21please helpindex.html<form enctype='multipart/form-data' action='yukle.php' method='POST'>   send it   <input name='userfile' type='file'> <input type='submit' value='Gönder'></form> <?$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&#305;lar&#305;$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 yoksaif (!is_dir($upload_dir)) { 	return 4;			}$file_name = $_FILES[$ufile]['name'];  // gönderilen dosyan&#305;n ad&#305;$file_type = $_FILES[$ufile]['type']; // gönderilen dosyan&#305;n tipi$file_ext  = strtolower(substr($file_name,strrpos($file_name,"."))); // dosyauzant&#305;s&#305;n&#305; alal&#305;mif (!empty($file_name) &&  !empty($file_type))  { // dosya ad&#305; ve tipi bo&#351; de&#287;ilseif (!in_array($file_type, $file_types) && !in_array($file_ext, $file_exts)) { // dosya tipleri ve dosya uzant&#305;s&#305; birbirine uygun mu ?return 6;	} else { // upload file$tempname  = $_FILES[$ufile]['tmp_name'];  // dosyan&#305;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&#305;n yeni adresi//  dosyan&#305;n yüklenmi&#351; oldu&#287;unu kontrol edelim,if(is_uploaded_file($tempname)){ // dosya yüklenmi&#351; iseif(!move_uploaded_file($tempname,$file_path)){// dosya ta&#351;&#305;namaz isereturn 7;                            }    else {if(!chmod($file_path, 0755)){// dosya izinleri verilemedireturn 8;} else {// dosya yüklendi ve kullan&#305;ma haz&#305;rreturn $file_path;}}} else { // dosya yükleme ile ilgili bir sorun var, bu bir sald&#305;r&#305; olabilirreturn 9;                        } }  } else { // içerik bo&#351;return 5;                } }?>