duangua6912
duangua6912
2009-12-13 07:03
浏览 36
已采纳

解析错误:语法错误,第15行E:\ xampp \ htdocs \ bidding \ header.php中的意外$结束[关闭]

Below is the code of

header.php

This file is included in another file, by

require 'header.php';

.

   <?php
    if(empty($user))
    { 
    $html=<<<eod
    <div class="account"><a href="publish.php">Post Task</a>  | <span class="boldfont"> $user</span> | <a href="../common/logout.php">Sign Out</a></div>
    eod;
    echo $html;
    }
    else { 
    $html=<<<eod
        <div class="account"><a href="../common/login.php">Sign in</a></div>
    eod;
    echo $html;
    ?>
    <a href="index.php"><img src="../common/logo.jpg" alt="Tenxian Logo" border=0 /></a>

However, I get an error message

Parse error: syntax error, unexpected $end in E:\xampp\htdocs\bidding\header.php on line 15

What's wrong?

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

2条回答 默认 最新

  • duansai1314
    duansai1314 2009-12-13 07:05
    已采纳

    think you need to properly close that else {

    else { 
    $html=<<<eod
        <div class="account"><a href="../common/login.php">Sign in</a></div>
    eod;
    echo $html;
    } // <--- is missing
    ?>
    
    点赞 评论
  • duaner1634
    duaner1634 2009-12-13 07:10

    As a general rule with PHP, 'unexpected end' means you go back and look for an unclosed block.

    A { is not matched by a }

    点赞 评论

相关推荐