意外的T_CONSTANT_ENCAPSED_STRING

时间:2013-03-28 16:39:27

标签: php mysql

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\system\reporting\download.php on line 136 

第136行是$filename=strtoupper($_SESSION["SystemNameStr"])'_LOGINHISTORY_'.date('Ymd').'.CSV';

if ($numlog>=1)
    {
    $filename=strtoupper($_SESSION["SystemNameStr"])'_LOGINHISTORY_'.date('Ymd').'.CSV';
    header("Pragma: public");  // Added to allow IE to download through SSL tunnels.
    header("Cache-Control: private");
    header("Content-Type: text/csv");
    header("Content-Disposition: attachment; filename=$filename ");

2 个答案:

答案 0 :(得分:2)

尝试使用“。”在strtoupper函数之后。

$filename=strtoupper($_SESSION["SystemNameStr"]).'LOGINHISTORY'.date('Ymd').'.CSV';

答案 1 :(得分:0)

$filename=strtoupper($_SESSION["SystemNameStr"])'_LOGINHISTORY_'.date('Ymd').'.CSV';

你没有像你认为的那样连接......使用:

$filename=strtoupper($_SESSION["SystemNameStr"]).'_LOGINHISTORY_'.date('Ymd').'.CSV';