Pandurang Ambre Pandurang Ambre - 9 months ago 20
HTML Question

How can i display GET output of a hyperlink on another php page (that includes the php page that contains GET request)

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>


Problem: Everytime I hit the link 'All categories' from the home.php page, the output is displayed on feed.php. I want it to be displayed on the home.php page where feed.php has been included.

Answer Source

Because you are calling feed.php?cat=1 in link:

<a href="./feed.php?cat=1"><li class="selected">All categories</li></a>

Try calling home.php

<a href="./home.php?cat=1"><li class="selected">All categories</li></a>