PHP基础导航帮助

currently i have :

$page = basename($_SERVER['REQUEST_URI']);

<li<?php if($page == 'index.php?page=product') print ' id="current"'; ?>><a href="index.php?page=product">Products</a></li>

but however when url is something like index.php?page=product&item=100

the class 'id=current' doesn't apply.

any workaround?

thank you for help.

if($_GET['page'] == 'product') instead of if($page == 'index.php?page=product')

$page = $_SERVER['PHP_SELF'].'?'.$_GET['page'];

If you'd like to see what is being sent to the $_GET and $_POST vars, you can dump them to the page with this one liner: <?php echo '<pre>' . print_r($_GET,true) . '</pre>'; ?>