2015-04-06 106 views
-2

嗨,我有這樣的代碼在PHP:Php解析錯誤意外;

$dt = md5(date('Y-m-d H:i:s'); 

    $uploadBookFile = $UPLOAD_DIR_BOOK."/".$dt.basename($_FILES['book']['name'])).".pdf"; 
    $uploadHomeFile = $UPLOAD_DIR_HOMEWORK."/".$dt.basename($_FILES['homework']['name'])).".pdf"; 

而且我收到此錯誤:Parse error: syntax error, unexpected ';' in /home/daltapps/public_html/server/CMS/addlecture/upload.php。我得到這個錯誤在$ DT

+0

您忘記了在您的'$ dt = md5(date('Ymd H:i:s')')中的右括號您需要仔細分析您的代碼......其他行,還有額外的右括號')'。在/home/daltapps/public_html/server/CMS/addlecture/upload.php 語法錯誤,意外「)」在這一行: – bcesars

回答

0

末使它看起來像這樣:

$dt = md5(date('Y-m-d H:i:s')); 

你錯過了閉架和下一行增加了兩個支架。代碼應該看起來像這樣:

$dt = md5(date('Y-m-d H:i:s'); 

    $uploadBookFile = $UPLOAD_DIR_BOOK."/".$dt.basename($_FILES['book']['name']).".pdf"; 
    $uploadHomeFile = $UPLOAD_DIR_HOMEWORK."/".$dt.basename($_FILES['homework']['name']).".pdf"; 
+0

不行的@IvanSelivanov,現在我只是得到這個錯誤 解析錯誤$ uploadBookFile = $ UPLOAD_DIR_BOOK。「/」。$ dt.basename($ _ FILES ['book'] ['name']))。「。pdf」; –

+0

是的。在$ _FILES ['book'] ['name']))後面的行中有兩個額外的括號。它應該像$ uploadBookFile = $ UPLOAD_DIR_BOOK。「/」。$ dt.basename($ _ FILES ['book'] ['name'])。「。pdf – IvanSelivanov

+0

哦,謝謝你,你是男人:) –