我想在一個頁面上使用Commentics php sript包含多個註釋部分。 首先,我試圖完成使用include
喜歡所以這個:<iframe>而不是包括
<div id="1">
<?php
include "comments_id1.php";
?>
</div>
<div id="2">
<?php
include "comments_id2.php";
?>
</div>
comments_id1.php:
<?php
session_start();
ob_start();
?>
[...]
<?php
$page_id = "1";
$reference = "Page One";
$path_to_comments_folder = "comments/";
define ('IN_COMMENTICS', 'true');
require $path_to_comments_folder . "includes/commentics.php";
?>
(comments_id2.php相應:$page_id = "2"; $reference = "Page Two"
)
顯然(和它可能是值得注意的是,對於PHP我仍然很笨拙),這不起作用,或者至少會導致各種麻煩(例如「警告:無法修改標題信息 - 標題已發送」)。
於是我想出了用的是標籤解決方案,例如:
<div id="1">
<iframe width="100%" src="comments_id1.php"></iframe>
</div>
<div id="2">
<iframe width="100%" src="comments_id2.php"></iframe>
</div>
現在,這裏是我的問題: 這甚至有人會推薦一個有效的解決方案?如果是的話,是否有任何使用的重大後果(除搜索引擎之外)? 如果這不是路要走,有什麼建議嗎?
謝謝!
這將在主頁面右側?不在個別評論頁面。無論如何,我無法讓它工作。雖然標題似乎不是問題,因爲我不再以某種方式得到這個警告。現在我沒有任何錯誤 - 它只是在第二次包含之後停止加載。 – Tim 2011-04-08 19:33:39