简体   繁体   中英

Why aren't my all my included php files showing? (CSS navigation tabs)

I have a php document that uses css navigation tabs to display 3 different files

<div id="Tum" class="w3-container training">
<h2>TUM</h2>
<?php include("tum.php");  ?>
</div>

<div id="Atol" class="w3-container training" style="display:none">
<h2>ATÖLYE</h2>
<?php include("atol2.php");  ?>
</div>

<div id="Uzman" class="w3-container training" style="display:none">
<h2>UZMANLIK</h2>
<?php include("uzman.php");  ?>
</div>

My test url is here

The first file loads fine - tum.php - however the next two do not. I think this is because they are almost identical. The three files pull facebook event data using json then populate in echoed html. I can't work out why the other 2 files are not being populated.

As I say the 3 included files are all similar, the only difference is:

$isMatch_atol = preg_match('/Atölyesi/', $name_atol);
if($isMatch_atol){

I use the pregmatch to filter the results from the json. Each individual page works if loaded alone.

I'm stuck as to why this is not working. Does anyone have any ideas?

Each 3 files had a declare function, which only needed to be declared once, that function being my date sorting:

function sortFunction($a,$b){
    if ($a['start_time'] == $b['start_time']) return 0;
    return strtotime($a['start_time']) - strtotime($b['start_time']);
}

Erasing that function from every file included after the first included file solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM