Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.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
Php 从其他页面中排除一个页面_Php - Fatal编程技术网

Php 从其他页面中排除一个页面

Php 从其他页面中排除一个页面,php,Php,我有一个关于如何在IF-php语句中将一个php页面从另一个页面中排除的问题。 这是我的代码: include 'category.php'; if(isset($_SESSION['ageSearch'])){ include 'age.php'; //exclude category.php here; } 有什么建议吗?谢谢 只需在else结构中包含category.php if(isset($_SESSION['ageSearch'])){

我有一个关于如何在IF-php语句中将一个php页面从另一个页面中排除的问题。 这是我的代码:

   include 'category.php';
     if(isset($_SESSION['ageSearch'])){
      include 'age.php';
      //exclude category.php here; }

有什么建议吗?谢谢

只需在
else
结构中包含
category.php

if(isset($_SESSION['ageSearch'])){
    include 'age.php';
}
else{
   include 'category.php';
}

只需在
else
结构中包含
category.php

if(isset($_SESSION['ageSearch'])){
    include 'age.php';
}
else{
   include 'category.php';
}

你为什么不那样做呢

if(isset($_SESSION['ageSearch'])){
    include 'age.php';
}
else
{
    include 'category.php';
}

你为什么不那样做呢

if(isset($_SESSION['ageSearch'])){
    include 'age.php';
}
else
{
    include 'category.php';
}

如果它真的有用,请将它标记为正确答案。干杯如果它真的有用,请将它标记为正确答案。干杯