Parse error received on unexpected T

I am recieving an error on the first line of code below which states:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ... on line 184

How can this error be fixed in code below:

$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>";

You cannot call functions from inside a string

Try

$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/69930.html

上一篇: 解析错误mysql 2个变量

下一篇: 在意外的T上收到解析错误