Reputation:
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.
Upvotes: 0
Views: 110
Reputation: 6878
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>'; ?>
Upvotes: 0
Reputation: 20601
if($_GET['page'] == 'product')
instead of if($page == 'index.php?page=product')
Upvotes: 5