[英]How can i display GET output of a hyperlink on another php page (that includes the php page that contains GET request)
home.php home.php
<?php
include("header.php");
include("session.php");
?>
<h3>Welcome <?php echo $login_session; ?></h3>
<?php include("feed.php"); ?>
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 categories.php
<a href="./feed.php?cat=1"><li class="selected">All categories</li></a>
Problem: Everytime I hit the link 'All categories' from the home.php page, the output is displayed on feed.php. 问题:每当我点击home.php页面中的“所有类别”链接时,输出都显示在feed.php上。 I want it to be displayed on the home.php page where feed.php has been included. 我希望它显示在home.php页面上,其中包含了feed.php。
Because you are calling feed.php?cat=1 in link: 因为你在链接中调用feed.php?cat = 1:
<a href="./feed.php?cat=1"><li class="selected">All categories</li></a>
Try calling home.php 试着打电话给home.php
<a href="./home.php?cat=1"><li class="selected">All categories</li></a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.