语法错误意外'<'在第11行

时间:2013-11-13 12:00:09

标签: 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='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>

1 个答案:

答案 0 :(得分: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 '<'错误。