<?php 
if($user_auth->haslogin){
echo '
<td><a href="/member/logout.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('i01','','/img/Common/menu_sub_01s.jpg',1)"><img style="margin-top:1px;margin-bottom:1px" border=0 name=i01 src="/img/Common/menu_sub_01.jpg" /></a></td>
';
}else{
?>
各位大哥帮看看上面这句哪里错了?错误提示:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in Index.php on line 6868行就是最上面的那句话

解决方案 »

  1.   


    首先不管你传过来判断的haslogin变量
    MM_swapImage('i01','','/img/Common/menu_sub_01s.jpg',1) 那么多单引号 不用转义吗?还有能看看你传过来的变量是怎么赋值的吗
      

  2.   

    <?php
    include_once('root.inc.php');
    include_once('lib/logic/News.php');
    include_once('control/ctl_news.inc.php');
    include_once('control/ctl_rank.inc.php');
    $news = new NewsController;
    $rank = new RankController;
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title><?php echo PAGE_TITLE;?></title>
    <meta http-equiv="Content-Type" content="text/html" charset="gbk" />
    <meta name="description" content="<?php echo PAGE_TITLE;?>" />
    <meta name="keywords" content="<?php echo PAGE_TITLE;?>" />
    <link rel="stylesheet" href="/common/css/Layout.css" />
    <link rel="stylesheet" href="/common/css/MainPage.css" />
    <link rel="shortcut icon" href="/Common/ran.ico" type="image/x-icon" />
    <script type="text/javascript" src="/Common/jquery-1.2.6.min.js"></script>
    <script type="text/javascript" src="/common/main.js"></script>
    <script type="text/javascript" src="/common/menu.js"></script>
    <script type="text/javascript" src="/common/screenshot.js"></script>
    </head>
    <body>
    <div id="wrap">
      <style>#gameStart { width:153px; height:265px; top:<?php if(!$user_auth->haslogin) echo '185'; else echo '165';?>px; margin-left:17px; z-index:0; }  </style>
      <div id="navigation"><script>useSwf("/Common/Flash/GNB.swf","897","208",1)</script></div>
      <div id="gameStart"><script>useSwf("/Common/Flash/main_start.swf","153","265",1)</script></div>
      <div id="mainVisual"><script>useSwf("/Common/Flash/main_visual.swf","597","421",1)</script></div>
      <div id="contentsWrap">
        <div id="contentsNavi">
          <div id="loginBox" class="upstairs">
            <?php 
    if($user_auth->haslogin){
    $user = $user_auth->getUserInfo();
    echo '
    <div style="background:url(\'/img/loginbg2.jpg\') no-repeat bottom left;width:190px;height:85px;padding-top:10px;margin-bottom:-17px">
    <div style="margin-left:20px;margin-top:-4px;color:#ffffff;text-align:left;line-height:16px;">
    <br>
    <strong>欢迎您, <span id="ctl00_UserID" style="color:#FFE32A;">',$user->userID,'</span></strong><br> <strong>积分: <span id="ctl00_GamePoint" style="color:#8FFAD0;">',$user->userPoint,'</span></strong>  <a href=member.php?do=payorder><font color=#FFFFFF>[充值]</font></a>
    </div>
    </div>
    ';
    }else{
    ?>
            <div id="loginIDNPW" style="margin:46px 0px 0px 0px;margin: 30px 0 0 1px!important; /* IE7+FF */">
              <iframe name="inner2" width="185" allowTransparency="true" height="80" src="member/ilogin.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe>
            </div>
            <?php } ?>
            <img src="/img/common/btn_idpw.gif" style="padding-top:-4px;"/>
            <div id="subMenu"> 
              <div class="subMenuBox">
                <div class="subMenuBox" style="padding-left:15px;height:100px">
                  <table border="0" style="border-collapse: collapse;border-spacing:0;table-layout: fixed;" >
                    <tr>
                      <?php 
    if($user_auth->haslogin){
    echo '
    <td><a href="/member/logout.php"><img style="margin-top:1px;margin-bottom:1px" border=0 name=i01 src="/img/Common/menu_sub_01.jpg" /></a></td>
    <td><a href="/member/logout.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('i01','','/img/Common/menu_sub_01s.jpg',1)"><img style="margin-top:1px;margin-bottom:1px" border=0 name=i01 src="/img/Common/menu_sub_01.jpg" /></a></td>
    ';
    }else{
    ?>
                      <td><a href="javascript:menu(1001);" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('i10','','/img/Common/menu_sub_10s.jpg',1)"><img style="margin-top:-1px;margin-bottom:-1px" border=0 name=i10 src="/img/Common/menu_sub_10.jpg" /></a></td>
                      <td align="right"><a href="javascript:menu(1002);" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('i11','','/img/Common/menu_sub_11s.jpg',1)"><img style="margin-top:-1px;margin-bottom:-1px;padding:0" border=0 name=i11 src="/img/Common/menu_sub_11.jpg" /></a></td>
                    </tr>
                    <?php } ?>
                    <tr>
                      <?php include_once('parts/SubMenuBox.php'); ?>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <div id="quickMenu"><script>useSwf("/Common/Flash/main_quick.swf","186","114",1)</script></div>
          <div id="mainBanner"><a href="javascript:menu(391);"><img src="/img/contents/btn_tester_Check.gif" /></a></div>
        </div>
        <div id="contentsBody">
          <div id="noticeBox" class="upstairs">
            <h3> <img src="/img/contents/tit_mainnotice.gif" /> <a href="/list.php"><img src="/img/common/btn_more.gif" width="39" height="10" alt="more" /></a> </h3>
            <br>
            <br>
            <ul>
              <?php
    $news->top12News();
    ?>
            </ul>
          </div>
          <div id="issuetalkBox"> <img src="/img/contents/tit_hotissue.gif">
            <div style="width: 350px; padding: 10px 0pt 0pt 10px;">
              <p><font color="#68a5cf">★</font><font color="#3399cc"><strong> </strong><strong>&lt;瘋狂的積分券&gt;</strong>活動開放中,全地圖瘋狂掉落! </font><font color="#0099cc">電算勝利者打破幸運箱子后會掉落300張-800張不等數量的高級積分券!</font></p>
            </div>
          </div>
          <div id="screenshotBox">
            <h3> <img src="/img/contents/tit_scshot.gif"> <a href="#;"><img src="/img/common/btn_more.gif" alt="more" height="10" width="39"></a> </h3>
            <div class="bx_shot"> <span id="ssthmb_01"><img src="/img/contents/bx_scshot_02.gif" class="png24" height="88" width="134"></span> <span id="ssthmb_02"><img src="/img/contents/bx_scshot_03.gif" class="png24" height="88" width="134"></span> <span id="ssthmb_03"><img src="/img/contents/bx_scshot_01.gif" class="png24" height="88" width="134"></span> </div>
          </div>
        </div>
        <div id="contentsExt" style="width:220px; float:left; margin:0; padding:0;">
          <div id="eventBanner" style="width:208px;height:142px;background:url(/img/main/ph.jpg) no-repeat 0px -3px;text-align:left;"><br>
            <font color=#eeeeee> <span style="height:15px;float:right;width:180px;text-align:right;padding-right:20px;margin-top:-17px"><a href='javascript:menu(21);'><img src="/img/common/btn_more.gif" width="39" height="10" alt="more" /></a></span>
            <ul style="margin-left:-1px;padding-top:3px;">
              <?php
    $rank->top5Character();
    ?>
            </ul>
            </font></div>
          <!--1-->
          <div id="eventBanner" style="width:208px;height:121px;background:url(/img/main/ds.jpg) no-repeat 0px -3px;text-align:left;"><br>
            <font color=#eeeeee>
            <ul style="margin-left:-1px;padding-top:3px;">
              <?php
    $rank->clubWarWinner();
    ?>
            </ul>
            </font></div>
          <!--1-->
          
          <div id="movieBox"><a href="javascript:menu(391);"><img src="/img/Common/main_movie_ready_090315.jpg" /></a></div>
          <a href="javascript:menu(23);" class="bannerButton"><img src="/img/banner/btn_bugreport.gif" /></a> <a href="javascript:menu(40);" class="bannerButton"><img src="/img/banner/btn_download.gif" /></a> </div>
        <div class="clear"> </div>
      </div>
      <div id="footer"> <img src="/img/Common/footer_main.gif" usemap="#copyright" />
        <map name="copyright" id="copyright">
          <area shape="rect" coords="458,16,624,36" href="mailto:[email protected]" alt="" />
        </map>
      </div>
    </div>
    </form>
    <?php
    display_query_console($db);
    $db->Close();
    ?>
    </body>
    </html>
      

  3.   

    那很明显 就是只是因为 你的 ECHO 出来的  HTML 的 单引号没有转义 \' 要在单引号前加 \