Creating an if statement for an included menu
<p>I have a menu that is consistent throughout one of my directories.  For example,</p>

<p>Main Page
Documents Page
Photos Page</p>

<p>I would expect to be able to include a menu like this into each page, and I'd be done.  However, this time it's a bit different, because the links generated by individual pages have to be different even though the destination is the same.  Take the link to the galleries.php page as an example:</p>

<pre><code>From the Home page:       &lt;a href='galleries.php?id=&lt;?=$id?&gt;'&gt;
From the Documents page:  &lt;a href='galleries.php?id=&lt;?=$doc[lid]?&gt;'&gt;
From the Photos page:     &lt;a href='galleries.php?id=&lt;?=$photo[lid]?&gt;'&gt;
From the Productss page:  &lt;a href='galleries.php??id=&lt;?=$product[lid]?&gt;'&gt;
</code></pre>

<p>></p>

<p>What I'm doing for now is to copy and paste the menu into each file, and changing the URL as needed, but this isn't a very satisfactory solution.  How can I build some sort of if statement in the menu itself so the correct link is generated by the page that is including the menu?</p>
