我在我的服务器上的子目录中构建(使用教程)我的CMS,它运行正常。管理,存档,完整显示和概要。
然后我将所有这些移动到我的主目录中,将index.php文件名更改为另一个并使用'include'将其显示在另一个页面的DIV中。
它显示页面的主要index.php元素,但在单击时不返回文章。
我搜索了文件以更改代码中的'index.php'的任何实例,但没有。 所有管理功能都能正常运行,并且博客条目的输出URL onclick与上一个目录中的先前文件相同。当然没有格式化,但这没有问题。
我犯了什么错误?我想避免使用iframe来解决此问题。
index.php文件包含的代码。 (homepage.php)
<?php include "templates/include/header.php" ?>
<ul id="headlines">
<?php foreach ( $results['articles'] as $article ) { ?>
<li>
<h2>
<span class="pubDate"><?php echo date('j F', $article->publicationDate)?></span><a href=".?action=viewArticle&articleId=<?php echo $article->id?>"><?php echo htmlspecialchars( $article->title )?></a>
</h2>
<p class="summary">
<?php if ( $imagePath = $article->getImagePath( IMG_TYPE_THUMB ) ) { ?>
<a href=".?action=viewArticle&articleId=<?php echo $article->id?>"><img class="articleImageThumb" src="<?php echo $imagePath?>" alt="Article Thumbnail" /></a>
<?php } ?>
<?php echo htmlspecialchars( $article->summary )?>
</p>
</li>
<?php } ?>
</ul>
<p><a href="./?action=archive">Archivo de Articulos</a></p>
<?php include "templates/include/footer.php" ?>