解析错误:语法错误,意外'。'用PHP?

时间:2013-10-01 11:12:35

标签: php mysql

我收到Parse错误:语法错误,意外'。'在C:\ xampp \ htdocs \ PHPExercise \ go4shop \ header.php中

php require("bar.php");
echo "<hr />";
if (isset($_SESSION['SESS_LOGGEDIN']) == T RUE) {
    echo "Logged in as <strong>".$_SESSION['SESS_USERNAME']."</strong>[<a href=" & quot;.$config_basedir. & quot;
    logout.php ">logout</a>]";
} else {
    echo "<a href=" & quot;.$config_basedir. & quot;
    login.php ">Login</a>";
}

1 个答案:

答案 0 :(得分:0)

重写您的代码。使用以下代码:

php require("bar.php");
echo "<hr/>";
if (isset($_SESSION['SESS_LOGGEDIN'])) {
    echo "Logged in as <strong>".$_SESSION['SESS_USERNAME']."</strong>[<a href='".$config_basedir."logout.php'>logout</a>]";
} else {
    echo "<a href='".$config_basedir."login.php'>Login</a>";
}

从代码中删除&quot;。并使代码可行。