Forum Moderators: coopster
I'm creating my navigation menu dynamically so they will be easy to update site wide at a later date.
So, I've got it working using the function below, however I want to be able to determine the current page and remove the anchor tags from that entry on the menu.
I figured out how to get the file name of the current page into a variable(Which will match $link[nav_href]). How should I proceed from here? I think I need an if/else statement but can't get it:(
function left_nav(){
$query = "SELECT * FROM cats WHERE cat_side = 'left'";
$cats = mysql_query($query);while($cat = mysql_fetch_array($cats)) {
echo "<h2>$cat[cat_name]</h2><div class='nav'>";
$query2 = "SELECT * FROM nav Where nav_cat_id = $cat[cat_id]";
$sql = mysql_query($query2);while($link = mysql_fetch_array($sql)) {
echo "<p><a href='$link[nav_href]'>
<img src='my_img.gif' /> $link[nav_name]</a></p>";}
echo "</div>";
}
}
Andreas
The XML spec defines [w3.org]:
AttValue ::= '"' ([^<&"] Ķ Reference)* '"'
Ķ "'" ([^<&'] Ķ Reference)* "'"
So I guess that means both single and double quotes are ok. I couldnīt find anything in the XHTML spec that is more restrictive.
I believe itīs SGML that allows only double quotes.
Andreas