Basically, in a nutshell, this is what I would like to do.
I have a main php page. Index.php
Index.php includes a seperate file for building certain elements, like the header, footer, and menu's.
Inside the construct.php I have a function that will build a menu. I want this menu to be dynamic, so that when a link is clicked, the menu will expand.
This is the code I have so far.
function DrawMessageMenu() {
echo "<font face=verdana size=2><img src=images/yellowicon.gif width=15 height=15> <a href=index.php?view=pm>Messages</a><br>";
if($view == "pm"){
echo"<br>
-<a href=messages.php?view=$view&o=send>Send</a><br>
-<a href=messages.php>Read New</a><br>
-<a href=messages.php?view=$view&o=read>Read All</a><br>";
}
else {
echo"<BR>";
}
}
As you can see, If the "Messages" link is followed, it passes index.php?view=pm to the browsers address bar. Since view==pm now, the rest of the menu should be drawn when the index.php calls this particular function again.
Well thats where I am hung up.. this function never seems to recognise that view==pm. I always get the 'else' called instead.
Any ideas?