donglvmang8638
donglvmang8638
2012-03-20 05:54
浏览 227
已采纳

意外的T_CONSTANT_ENCAPSED_STRING错误[已关闭]

I am getting an UNEXPECTED T_CONSTANT_ENCAPSED_STRING error in this line

 $portfolio_html.= '<li> <a href=" "><img height="54" width="60" 
  src="images/portfolio_uploads/orig_'.$portfolio_item['image'].'"></a></li>';

Can any body help??

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • doulan8330
    doulan8330 2012-03-20 05:59
    已采纳

    You started your comment /* before your concatenation . to resolve, add a . after a href=" ' on line 1, or move your starting block comment to after the period.

    点赞 评论
  • dongnius85154
    dongnius85154 2012-03-20 05:56
    $ php
    <?php
    echo 'a' 'b';
    PHP Parse error:  syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in - on line 2
    
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in - on line 2
    

    You forgot a period between your string literals.

    点赞 评论
  • doupian6118
    doupian6118 2012-03-20 05:59
    $portfolio_html.= "<li> <a href='" . HTTP_SERVER . $ilpage['portfolio'] . "?cmd=zoom&amp;item=" . $portfolio_item['id'] . "&amp;id=" . $portfolio_item['user_id'] ."><img height='54' width='60' src='images/portfolio_uploads/orig_" .$portfolio_item['image']. "'></a></li>';
    

    check this out. and i have removed the comment form it.

    点赞 评论
  • doushadu0901
    doushadu0901 2012-03-20 06:01

    Your syntax is not proper , check your href you are adding comment try this

     $portfolio_html.='<li> <a href=" ' . HTTP_SERVER . $ilpage['portfolio'] .     
     '?cmd=zoom&amp;item=' . $portfolio_item['id'] . '&amp;id=' . $portfolio_item['user_id'] 
     .'"><img height="54" width="60" src="images/portfolio_uploads
      /orig_'.$portfolio_item['image'].'"></a></li>';
    
    点赞 评论

相关推荐