Hi,
I have an HTML menu and i have styled it with CSS to highlight the current page. as i have more then 8 pages using the same code. i wanted to do something dynamic and i created a PHP function for that,
here is my code..
<?php function hiddenmenu($activeicon1 = 0, $activeicon2 = 0, $activeicon3 = 0, $activeicon4 = 0,
$activeicon5 = 0, $activeicon6 = 0, $activeicon7 = 0, $activeicon8 = 0, $activeicon9 = 0) {
?>
<div class="icon-no-spacer">
<p><a id="<?php echo $activeicon1; ?>" href="index.php" title=""><img src="images/icons/48/display.png" alt="" />Dashboard</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon2; ?>" href="post-news.php" title=""><img src="images/icons/48/text_rtf.png" alt="" />Post News</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon3; ?>" href="news.php" title=""><img src="images/icons/48/wordprocessing.png" alt="" />News</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon4; ?>" href="post-advertisement.php" title="" ><img src="images/icons/48/view_pim_news.png" alt="" />Post Ad</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon5; ?>" href="advertisement.php" title=""><img src="images/icons/48/view_pim_tasks.png" alt="" />Advertise</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon6; ?>" href="comments.html" title=""><img src="images/icons/48/spread.png" alt="" />Comments</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon7; ?>" href="#" title=""><img src="images/icons/48/rss_tag.png" alt="" />Sponsors</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon8; ?>" href="#" title=""><img src="images/icons/48/fileview_preview.png" alt="" />Video</a></p>
</div>
<div class="icon-spacer">
<p><a id="<?php echo $activeicon9; ?>" href="information.php" title="" ><img src="images/icons/48/help_about.png" alt="" />Information</a></p>
</div>
<?php
}
?>
the code is working perfectly fine. is it ok to go with this. ?? lot of people might have come accross this type of issue i want to know the best feasible solution for this..
thank you