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 align="right">$username $moment</div>
    htm; 
    }
    echo $item;
    ?>
However, I get an error
<br /> <b>Parse error</b>: syntax error, unexpected $end inE:\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.