【发布时间】:2013-02-28 17:24:00
【问题描述】:
由于某些 php 代码不断将其重定向到自身,我无法弄清楚如何让一个页面在不重定向到自身的情况下点击它的链接。
$option = $_GET[option];
$view = $_GET[view];
if (!$option) {
include "include/index_main.php"; // INDEX MAIN TOP FILE
}
elseif ($option == 'com_newsfeeds' and $view == 'newsfeed') {
include "include/news.php"; // NEWS FILE
}
elseif ($option == 'com_content' and $view == 'category') {
switch($_GET[id]) {
case '75':
include "include/children_list.php"; // Children List FILE
break;
case '77':
include "include/food_for_kids.php"; // Food 4 Kids page
break;
case '76':
include "include/water_for_life.php"; // Water for Life page
break;
default:
if (empty($_GET[listing_id]) || $_GET[listing_id] == '') {
include "include/projects.php"; // Projects FILE
break;
}
else {
include "include/project_list.php"; // Project Listing FILE
break;
}
}
}
elseif... ... ...
当页面没有任何指向它自己的类别的链接时,这很有效,但是带有标记的地图都有链接,这些链接似乎被重定向回页面而不是它们应该去的地方。
问题出在 case '76': 部分
据我所知,当类别 id 为 76 时,php 调用 water_for_life.php 包含。不幸的是,它没有区分:
.org/index.php?option=com_content&view=category&id=76
和
.org/index.php?option=com_content&view=category&id=76&listing_id=76&sid=dl94q3tlfqr2s58c3u1mfnf1t1
毕竟,我想我的问题是:
有没有办法一直跳过到 include/project_list.php 一旦有人点击了具有如下链接的链接:
.org/index.php?option=com_content&view=category&id=76&listing_id=76&sid=dl94q3tlfqr2s58c3u1mfnf1t1
?
【问题讨论】: