Trying to make the current page on the site highlighted:
<div id="nav"> <ul> <li> <a <?php echo ($_GET['page'] == 'index' || !isset($_GET[page])) ? "class='active'" : ""; ?> href="index1.php">Главная</a> </li> <li> <a <?php echo ($_GET['page'] == 'news') ? "class='active'" : ""; ?> href="index2.php">Новости</a> </li> <li> <a <?php echo ($_GET['page'] == 'about') ? "class='active'" : ""; ?> href="index3.php">О сайте</a> </li> </ul> </div> Shows an error at startup
Undefined index: page
Tell me, how can I fix it? I don’t consider the JS option yet, with the script the site navigation stops working))))
filter_input()- ArchDemon