-4

语法错误意外'<'

代码是:

$new_notifs = mysql_query("SELECT ID FROM Notifications WHERE ToID='$MyID' AND IsNew='1'") or die(mysql_error());
    $new_notifs = mysql_num_rows($new_notifs);
    if($new_notifs>0) {
        $new_notif_block = " disBlock";
    } else {
        $new_notif_block = NULL;
        $new_notifs = NULL;
    }
        <div id='header'>
        <div id='headerContainer'>
            <h1 id='pageLogo'>
                <a href='./' title="Home"></a>
            </h1>
            <div id='fbRequestsJewel' class='fbJewel<?php echo $new_friend_active; ?>'>
                <span class='fbJewelNotif<?php echo $new_friend_block; ?>' id='requestJewelNotif'><?php echo $new_friends;?></span>
                <div id='fbJewelRequestsPopup' class="jewelPopup">
                    <div class='fbJRPcover disBlock'></div>
                    <div class='fbJewelTitle'>
                        Friend Requests
                        <a class='fright lightBlue noBold' href='find.php'>Find Friends</a>
                    </div>
4

1 回答 1

2

关闭你的 PHP 标签:

    $new_notifs = mysql_query("SELECT ID FROM Notifications WHERE ToID='$MyID' AND IsNew='1'") or die(mysql_error());
    $new_notifs = mysql_num_rows($new_notifs);
    if($new_notifs>0) {
        $new_notif_block = " disBlock";
    } else {
        $new_notif_block = NULL;
        $new_notifs = NULL;
    }
    ?>
    <div id='header'>

注意?>之前的<div id='header'>.

目前,您没有关闭 PHP 标签,这意味着 PHP 正在尝试(并且失败)解析<div id='header'>,因此出现Syntax error unexpected '<'错误。

于 2013-11-13T12:05:06.140 回答