in an earlier post "PHP set active link on page using includes" there was a comment "That is waaaay too hackable". can you explain to me how it is hackable and how i can duplicate this idea with a safer method.
$page_id = $_REQUEST['page_id'];
<ul>
<li class="<?php echo ($page_id == "Home" ? "active" : "");?>">
<a href="/">Home</a>
</li>
<li class="<?php echo ($page_id == "Apps" ? "active" : "");?>">
<a href="#">Apps</a>
</li>
<li class="<?php echo ($page_id == "Forums" ? "active" : ""); ?>">
<a href="#">Forums</a>
</li>
</ul>
I am building my first plugin for a website and i need to have links that php sets to active if you are on the page such as home or statistics. so the installation may be at www.website.com/home/plugin/statistics. I need to be able to set the class
statistics to active if they are on the page without knowing how many layers deep in their website my plugin is installed.