Php Parse错误意外;

时间:2015-04-06 19:59:53

标签: php parsing

嗨我在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

结束时收到此错误

1 个答案:

答案 0 :(得分: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";