-2

我收到解析错误:语法错误,意外的“。” 在 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>";
}
4

1 回答 1

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;从代码中删除。并使代码可行。

于 2013-10-01T11:16:35.860 回答