Below is the code of viewhistory.php.

下面是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 in

E:\xampp\htdocs\online\viewhistory.php on line 43

E:\ xampp \根\ \ viewhistory在线。php在43行

when I run it. What is wrong? Is a half bracket missing? But It seems all brackets are paired.

当我运行它。是什么错了吗?半括号不见了吗?但是似乎所有的括号都是成对的。

2 个解决方案

#1


4

You've got trailing whitespace after htm; on line 43. Remove it and the parse error will go away.

在htm之后,你有尾随空格;43行上。删除它,解析错误就会消失。

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 .=.

而且,看起来您试图使用+=操作符将在htm中创建的字符串连接起来。那应该改成。=。

更多相关文章

  1. PHP实现接口方法时出现致命错误
  2. JSON解析错误:无法识别的标记'<'处于角度
  3. 在提交注册表单时使用jQuery显示错误
  4. 获取所有网站的错误,[重复]
  5. 如何让jQuery ajax执行错误功能
  6. Yii 访问 Gii(脚手架)时出现 403 错误
  7. PHP强大包括处理错误?
  8. 您是否认为PHP中的错误形式是在类方法中访问超级全局变量?
  9. 解析错误:语法错误,第12行/home/public_html/gigs.html中的意外T_L

随机推荐

  1. android从网上加载图片简单示例
  2. 关于Android重力感应器的频率的分析
  3. android使用adb命令安装软件
  4. Android(安卓)游戏引擎libgdx 如何添加万
  5. android文件读取
  6. Android EditText保留小数点后两位
  7. Android(安卓)Studio 配置使用GreenDao3.
  8. Android Q 下拉状态栏快捷开关解析
  9. 传智播客Android核心基础课程视频教程(收
  10. android studio编译错误 之 Cause: com/a