Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Joomla PHP elseif将页面重定向回自身_Php_Joomla - Fatal编程技术网

Joomla PHP elseif将页面重定向回自身

Joomla PHP elseif将页面重定向回自身,php,joomla,Php,Joomla,我不知道如何让一个页面在不重定向到自身的情况下让其链接被点击,因为一些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') { inclu

我不知道如何让一个页面在不重定向到自身的情况下让其链接被点击,因为一些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... ... ...
当页面没有任何指向自己类别的链接时,这种方法非常有效,但是带有标记的地图都有链接,这些链接似乎被重定向回页面,而不是它们应该去的地方

问题在于案例“76”:部分

据我所知,当类别id为76时,php调用water_for_life.php include。不幸的是,它没有区分:

.org/index.php?option=com_content&view=category&id=76

所以在所有这些之后,我想我的问题是:

是否有办法将其完全跳过到include/project_list.php 一旦有人点击了这样的链接:

.org/index.php?option=com_content&view=category&id=76&listing_id=76&sid=dl94q3tlfqr2s58c3u1mfnf1t1

你是说像这样的事吗?请注意,它适用于与id相关的所有情况,无论是76或77或其他

...
elseif ($option == 'com_content' and $view == 'category') {
if (!empty($_GET['listing_id'])) {
    include "include/project_list.php"; // Project Listing FILE 
}
else {
  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:
        include "include/projects.php"; // Projects FILE
        break;  
    } 
}
...

先生,你真了不起@Marko。非常感谢。我在这方面完全是个新手,但要了解更多。我希望我能投上这一票,一旦我得到足够的支持,我就会投。
...
elseif ($option == 'com_content' and $view == 'category') {
if (!empty($_GET['listing_id'])) {
    include "include/project_list.php"; // Project Listing FILE 
}
else {
  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:
        include "include/projects.php"; // Projects FILE
        break;  
    } 
}
...