Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m trying to put my menu on all the web pages instead of putting the code on s

ID: 3545759 • Letter: I

Question

I'm trying to put my menu on all the web pages instead of putting the code on seperate web pages. I've been reading about php (which I've never used before) and I found that this method <?php include('navigation.php'); ?> is supposed to do the trick, but I get nothing. Obviously I don't understand php, but if anyone can help me my navigation.php currently look like this:


echo '

<img src="Images/original2.jpg"  alt="Logo"  longdesc="" />

<div id="menu1">

    <ul class="menu">

<li><a title="" href="page1.html">Page1</a></li>

        <li><a class="haschild"title="" href="Page2.html">Page2</a>

            <ul class="sub-menu">

                <li><a href="Page2-1.html">Page2-1</a></li>

                </li>

            </ul>

<li><a href="Page3.html">Page3</a></li>

<li><a href="Page4.html">Page4</a>

        <li><a class="haschild" title="" href="Page5.html">Page5</a>

            <ul class="sub-menu">

<li><a href="Page5-1.html">Page5-1</a></li>

<li><a title="" href="Page5-2.html">Page5-2</a></li>

                <li><a href="Page5-3.html">Page5-3</a></li>

<li><a title="" href="Page5-4.html">Page5-4</a></li>

                </li>

            </ul>

<li><a href="Page6.html">Page6</a></li>

<li><a class="haschild" title="" href="Page7.html">Page7</a>

            <ul class="sub-menu">

                <li><a title="" href="Page7-1.html">Page7-1</a></li>

                </li>

            </ul>

    </ul>

    <div class="clear"></div>

</div>';

I'm trying to put my menu on all the web pages instead of putting the code on seperate web pages. I've been reading about php (which I've never used before) and I found that this method is supposed to do the trick, but I get nothing. Obviously I don't understand php, but if anyone can help me my navigation.php currently look like this:

Explanation / Answer

Hi, First of All, php is not understood by HTML browser, Instead a php server is there to understand the php code and makes pages behave accordingly. There are ways to include a page or div in another page using different JS libraries. Let me know if u need more clarification or examples