在意外的T上收到解析错误

我在下面的第一行代码中收到错误,其中声明:

解析错误:语法错误,意外的T_ENCAPSED_AND_WHITESPACE,期望T_STRING或T_VARIABLE或T_NUM_STRING in ... on line 184

如何在下面的代码中解决这个错误:

$assessmentform = "<form action='echo htmlentities($_SERVER['PHP_SELF']);' method='post'>
<p>Assessments: echo $sessionHTML; </p>
<p><input id='sessionSubmit' type='submit' value='Submit Assessment' name='sessionSubmit' /></p>      
</form>";

你不能从字符串中调用函数

尝试

$assessmentform = "<form action='".htmlentities($_SERVER['PHP_SELF'])."' method='post'>
<p>Assessments: {$sessionHTML} </p>
<p><input id='sessionSubmit' type='submit' value='Submit Assessment' name='sessionSubmit' /></p>      
</form>";
链接地址: http://www.djcxy.com/p/69929.html

上一篇: Parse error received on unexpected T

下一篇: How to take mysql dump of selected columns of a table