tags:

views:

74

answers:

2

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?

+5  A: 

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
?>
nowk
+2  A: 

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

A { is not matched by a }

pavium