<br /> <b>Parse error</b>: syntax error, unexpected $end in <b>E:\xampp\htdocs\online\viewhistory.php</b> on line <b>43</b><br />
Below is the code of viewhistory.php.
<?php
foreach($_POST as $value){
if (empty($value))
{ echo 1;
exit();
}
}
//come code;
//SQL query;
while($row=mysql_fetch_assoc($result))
{
//some code;
if (!empty($reference))
{
$referencetxt=<<<html
| Referenced Solution ID:$reference
html;
}
else {
$referencetxt=" ";
}
$item+=<<<htm
<hr>
<span>Solution ID:$productid $referencetxt</span>
<xmp>$text</xmp>
<img src=$imagepath />
<div ali开发者_如何学JAVAgn="right">$username $moment</div>
htm;
}
echo $item;
?>
However, I get an error
<br /> <b>Parse error</b>: syntax error, unexpected $end in
E:\xampp\htdocs\online\viewhistory.php on line 43
when I run it. What is wrong? Is a half bracket missing? But It seems all brackets are paired.
You've got trailing whitespace after htm;
on line 43. Remove it and the parse error will go away.
Also, It looks like you're trying to concatenate the string created in the htm
heredoc using the +=
operator. That should probably be changed to .=
.
I dont think this is the issue but $item+=<<<htm
should be $item.=<<<htm
.
精彩评论