Do you mean something like this? :
PHP Code:
<ul>
<?php /* current page */ $currentPage = $_SERVER['SCRIPT_NAME'];
/* full path URL, including query*/ $fullpath = basename($_SERVER['REQUEST_URI']); // e.g. -> the_decades.php?ID=59
?>
<li><a href="about_the_artist.php" <?php if ($currentPage == 'about_the_artist.php') {echo 'id="select"';} ?>>Introduction</a></li>
<li><a href="c._v._&_exhibitions.php" <?php if ($currentPage == 'c._v._&_exhibitions.php') {echo 'id="select"';} ?>>C.V. / Exhibitions</a></li>
<li><a href="#">Buy Prints</a></li>
</ul>
<h2>The Decades:</h2>
<?php
//echo linked results from db
// query db
$sql = mysql_query ("SELECT * FROM `decades` ORDER BY ID ASC");
// echo linked result from db
while ($row = mysql_fetch_assoc($sql)){
echo "<ul><li>" . "<a href='the_decades.php?ID={$row['ID']}' "; echo ($fullpath == "the_decades.php?ID={$row['ID']}") ? 'id="select"' : ''; echo ">" . ($row['Date']) . "</a></li></ul>";
}
?>
The way you have it at the moment, using $_SERVER['SCRIPT_NAME'] you can't get the full query, so it just gets the page name, instead of grabbing the rest of it (everything after the question mark).
I think this is what you want, but just say if this doesn't work for you.
Bookmarks