Hello, I encountered such a problem. I want to highlight the active tabs, but when I add an index, the ticket stops working correctly

Works fine;

$class = 'navigation__sub'; if (basename($_SERVER['PHP_SELF']) == 'tickets.php') $class = 'navigation__sub navigation__sub--active navigation__sub--toggled'; 

And if you do already

 $class = 'navigation__sub'; if (basename($_SERVER['PHP_SELF']) == 'tickets.php' || 'index.php') $class = 'navigation__sub navigation__sub--active navigation__sub--toggled'; 

then all the tabs start to glow when you switch to any tab, how can I fix it?

The output of the class $ active;

  • one
    if (basename ($ _ SERVER ['PHP_SELF']) == 'tickets.php' || basename ($ _ SERVER ['PHP_SELF']) == 'index.php') - Kirill Malyshev
  • The expression 'index.php' will always be true . Use the conditions correctly. The correct version of your condition was given by the previous commentator. - Pyramidhead
  • it doesn't work that way either, I already tried it - NexFive
  • @NexFive, this option is correct and it works exactly, unless, of course, you have errors elsewhere. - Pyramidhead
  • @Pyramidhead, unfortunately does not work, two tabs are lit. And the one that I'm on now should shine - NexFive

0