View Single Post
ישן 23-08-06, 14:56   # 16
amirs_5
הוסטסניון
 
amirs_5's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: ת"א
גיל: 34
הודעות: 2,168
שלח הודעה באמצעות ICO אל amirs_5 Send a message via Skype™ to amirs_5

amirs_5 לא מחובר  

כן צודק בגללי שעשעיתי בטעות קו כזה (-) במקום קו תחתון (_)

טוב עכשיו , זה עובד אבל יש לי עוד בעיה בקשר למערכת העלאת שירים הזאתי שאני בונה , זאת הראשונה
אממ זה הקוד שרשמתי ..:

PHP קוד:
    $error "";

           if(
$_FILES['file']['name']==''$error .= "לא נבחר קובץ.";

                 
$file $_FILES['file']['name'];

                   list(
$name,$ext) = explode(".",$file);

                   if ((
$ext != "mp3") && ($ext != "MP3") && ($ext != "wma") && ($ext != "WMA"))
                   
$error "לא ניתן להעלות את הקובץ ".$name." הסיומת ".$ext." אינה חוקית";

            if(
$_FILES['file']['size'] > (1048576*5)) $error .= "הינתן להעלות קובץ עד 5 מגה בלבד";

            if(!
preg_match("/^[a-zA-Z0-9 _\.]+$/"$file)) $error "שם הקובץ יכול להכיל אך ורק מספרים קו תחתון ואותיות לועזיות";  

            
$qfile mysql_query("SELECT * FROM `mysongs_files` WHERE `mid` = '{$this->user['id']}' ORDER BY time DESC LIMIT 1"); 
            if(
$file mysql_fetch_array($qfile)) {
            
$joined $file['time'];
                if(
$joined > ($time-60*60*3)) $error .= "בין כל פרסום קובץ , יש לחכות 3 שעות.";
            }

                if(
$_FILES['file']['error']!=0$error .= "אירעה שגיאה בהעלאת הקובץ.";

        if(
$error == "") {

                
$time time(); 
                
$prefix$time."-";

            if(
move_uploaded_file($_FILES['file']['tmp_name'],$dir.$prefix.$file)) {
            echo 
'הקובץ הועלה בהצלחה!';
            } else {
            echo 
'שגיאה בהעברת הקובץ, אנא נסה שנית';
            exit;
            }

                    
$mid $this->user['id'];
                    
$file $prefix.$file
                    
$name $_POST['name'];
                    
$janer $_POST['janer'];
                    
$words $_POST['words'];
                    
$notes $_POST['notes'];

            
mysql_query("INSERT INTO `mysongs_files` ( `id` , `mid` , `file` , `name` , `janer` , `words` , `notes` , `time` ) VALUES ('', '$mid', '$file', '$name', '$janer', '$words', '$notes', '$time')") or die("שגיאה, אנא נסה שנית.");
            
mysql_query("UPDATE mysongs_members SET works=works+1 WHERE id='$mid'");
            echo 
"הקובץ הועלה בהצלחה";

        } else echo 
$error
עכשיו שאני מעלה קבצים בגודל של מגה זה מעלה,
שאני מעלה קובץ של 4.70 מגה הוא לא מעלה, ומביא לי את השגיאה הבאה :
"אירעה שגיאה בהעלאת הקובץ."
יש למישהו מושג למה ?
משהו לאא טוב פה אני שובר תראש כבר כמה ימים על זה ..:S
__________________
אימיל \ מסן : amirs91 [at] gmail.com
  Reply With Quote