2016-03-25 73 views
0

我試圖使用PHP代碼的網頁上顯示一個評論框投擲結果:包含PHP是在頭

$object_id = 'article_12'; 
include('commentanything/php/loadComments.php'); 

出於某種原因,評論框沒有出現在那裏我希望它出現,它不斷拋出評論欄頭,有沒有什麼辦法可以使它看起來正是我希望它在這裏?,是我想使用它(不是一個完整的代碼):

<!--<h1 align="center" style="font-size:1.2em"><strong>'.$row['title'].'</strong></h1>--> 

          <div class="song-art"><a href="'.$this->url.'/mp3download/'.$row['id'].'/'.$this->genSlug($row['title']).'.html"><img src="'.$this->url.'/thumb.php?src='.$row['art'].'&t=m&w=112&h=112" id="song-art'.$row['id'].'" title="'.$row['title'].'" alt="'.$row['title'].'"/></a></div> 
          <div class="song-top"> 
           <div class="song-timeago"> 
             <a href="'.$this->url.'/mp3download/'.$row['id'].'/'.$this->genSlug($row['title']).'.html"><span id="time'.$row['id'].'"> 
              <div class="timeago'.$b.'" title="'.$time.'"> 
               '.$time.' 
              </div> 
             </span> 
            </a> 
           </div> 
           <div data-track-name="'.$row['name'].'" data-track-id="'.$row['id'].'" id="play'.$row['id'].'" class="track song-play-btn"> 
           </div> 
           <div class="song-titles"> 
            <div class="song-author"><a onmouseover="profileCard('.$row['idu'].', '.$row['id'].', 0, 0);" onmouseout="profileCard(0, 0, 0, 1);" onclick="profileCard(0, 0, 1, 1);" href="'.$this->url.'/index.php?a=profile&u='.$row['username'].'">'.realName($row['username'], $row['first_name'], $row['last_name']).'</a></div> 
            <div class="song-tag"> 
            <a href="'.$this->url.'/index.php?a=explore&filter='.$tag.'">'.$tag.'</a> 
            </div> 
            <div class="song-title"> 
    <div class="track-link"><h2 style="font-size:1.0em"> 
    <!--<a href="'.$this->url.'/mp3download/'.$row['id'].'/'.$this->genSlug($row['title']).'.html" id="song-url'.$row['id'].'"><div id="song-name'.$row['id'].'">'.$row['title'].'</div></a>--> 
    </h2></div> 
            </div> 
           </div> 
          </div> 
          <div class="player-controls"> 
           <div id="song-controls'.$row['id'].'"> 
            <div id="jp_container_123" class="jp-audio"> 
             <div class="jp-type-single"> 
               <div class="jp-gui jp-interface"> 
                <div class="jp-progress"> 
                 <div class="jp-seek-bar"> 
                 <div class="jp-play-bar"></div> 
                </div> 
               </div> 
              </div> 
             </div> 
            </div> 
           </div> 
          </div> 

          <div class="track-actions-container">               

          </div> 
           '.$extra_links.' 
           '.$seo_links.' 

          '.$comment.' 

          '.$charts.' 
         </div>'; 


$object_id = 'article_12'; 
include('commentanything/php/loadComments.php');  



        $start = (isset($row['extra_id'])) ? $row['extra_id'] : $row['id']; 
       } 
      } 

我我試圖在'。$ charts'之後顯示它。但它始終顯示在標題

回答

0

它看起來像你沒有工作匹配索引和loadComments.php中的HTML。

首先將您的loadComments.php代碼複製到include('commentanything/php/loadComments.php')位置。

並檢查html/css錯誤。在那。

如果它也失敗了,你的php/html嵌套是錯誤的,我不能告訴,因爲你甚至沒有用過我們知道如何以及在哪裏填充php。您只需在上面顯示的代碼中添加變量