home.php
<?php
include("header.php");
include("session.php");
?>
<h3>Welcome <?php echo $login_session; ?></h3>
<?php include("feed.php"); ?>
feed.php
<?php include("categories.php");
function Qfeed($cat){
//output is echoed here...
}
if(isset($_GET["cat"])) {
$cat = $_GET["cat"];
Qfeed($cat);
}
?>
categories.php
<a href="./feed.php?cat=1"><li class="selected">All categories</li></a>
问题:每次我点击链接“所有类别&#39;从home.php页面,输出显示在feed.php上。我希望它显示在home.php页面上,其中包含了feed.php。
答案 0 :(得分:0)
因为您在链接中调用了feed.php?cat = 1:
<a href="./feed.php?cat=1"><li class="selected">All categories</li></a>
尝试拨打home.php
<a href="./home.php?cat=1"><li class="selected">All categories</li></a>