简体   繁体   English

如何在另一个php页面(包括包含GET请求的php页面)上显示超链接的GET输出

[英]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.

相关问题 在PHP页面中有一个GET请求超链接,它本身在另一个相似的超链接之后被调用 - Having a GET request hyperlink in PHP page that itself is called upon following another similar hyperlink 我如何获得总价并将其显示在同一页面上PHP - How can i get the total price and display it in the same page PHP 如何在另一页上获取vbulletin注销哈希? (PHP) - How can I get the vbulletin logout hash on another page? (PHP) 在另一页上显示PHP的输出 - Display output of PHP on another page 我正在尝试将数据从MySQL显示到包含表格的PHP页面,但我无法在表格中显示信息 - I'm trying to display data from MySQL onto a PHP page that contains a table but I can't get the info to display inside the table PHP如何调用另一个页面并将输出作为变量? - How to PHP call another page and get output as variable? 如何从php文件获取输出,以显示在调用它的wordpress页面上的div中? - How do I get output from php file to display in a div on the wordpress page that called it? 如何在php中获取特定超链接的值,如果单击,则将该命名链接的会话发送到另一个页面 - How to get the values of a specific hyperlink in php and if click, send to another page the session of that named link 我如何使用php从另一页的多个值中获取下一页的单个值 - how can i get single value at next page from multiple values in another page using php 如何在同一 HTML 页面上显示 HTML GET 请求数据,使用单独的 PHP 文件来获取它? - How do I display the HTML GET request data on the same HTML page, using a separate PHP file to fetch it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM