Yes, I understand what you mean, but the file you include the PHP file with must be php as well. You can't include a php file in a normal HTML file. Do the following:
1. Save the following code to a php file called menu.php
PHP Code:
<?php
echo "<div id=\"myslidemenu\" class=\"jqueryslidemenu\">
<ul>
<li><a href=\"http://www.dynamicdrive.com\">Communications</a></li>
<!--Single row-->
<li><a href=\"#\">Home</a>
<ul>
<li><a href=\"#\">Location</a></li>
<li><a href=\"#\">Disclaimer</a></li>
<li><a href=\"#\">Contact Us</a></li>
<li><a href=\"#\">F.A.Q.</a></li>
</ul>
</li>
<!--text-->
<li><a href=\"#\">Services</a>
<ul>
<li><a href=\"#\">WebDesign</a></li>
<li><a href=\"#\">Computer</a>
<ul>
<li><a href=\"#\">Sub Item 2.1.1</a></li>
<li><a href=\"#\">Sub Item 2.1.2</a></li>
<li><a href=\"#\">Folder 3.1.1</a>
<ul>
<li><a href=\"#\">Sub Item 3.1.1.1</a></li>
<li><a href=\"#\">Sub Item 3.1.1.2</a></li>
<li><a href=\"#\">Sub Item 3.1.1.3</a></li>
<li><a href=\"#\">Sub Item 3.1.1.4</a></li>
<li><a href=\"#\">Sub Item 3.1.1.5</a></li>
</ul>
</li>
<li><a href=\"#\">Sub Item 2.1.4</a></li>
</ul>
</li>
</ul>
</li>
<li><a href=\"http://www.dynamicdrive.com/style/\">Item 4</a></li>
</ul>
<br style=\"clear: left\" />
</div>";
?>
2. Rename your current HTML file to have the extension .php instead of HTML. Example: index.html ---> index.php, you don't have to change anything else, just rename the file index.php
3. Put the include somewhere in index.php where you want the menu to be.
Code:
<html>
<head>
<title>My Page</title>
</head>
<body>
<div id="header">Welcome to my site</div>
<div id="menu"> // Include the menu in this div
<?php
include("menu.php");
?>
</div>
</body>
</html>
Just test that out, obviously the divs I made there aren't going to be the same on your page, but it was just to give you an idea.
You can then implement the same menu.php in different pages.
Hope that helps.
Bookmarks