日期:2014-05-16  浏览次数:20630 次

PHP根据导航条页面改变CSS样式
<?php
    $current = !empty($_GET['cur']) ? $_GET['cur'] : 'home';
?>
<div class="menu">
   <ul>
      <li><A <?php if($current=='home')echo 'class="current"'; ?> href="index.php?cur=home">首  页</a></li>
      <li><A <?php if($current=='jieshao')echo 'class="current"'; ?> href="1.php?cur=jieshao">公司介绍</a></li>
      <li><A <?php if($current=='new')echo 'class="current"'; ?> href="2.php?cur=new">公司新闻</a></li>
      <li><A <?php if($current=='zhaopin')echo 'class="current"'; ?> href="3.php?cur=zhaopin">招聘信息</a></li>
      <li><A <?php if($current=='lianxi')echo 'class="current"'; ?> href="4.php?cur=lianxi">联系我们</a></li>
      <li><A <?php if($current=='about')echo 'class="current"'; ?> href="5.php?cur=about">关于我们</A></li>
   </ul>
</div>

?