Many thanks for the detailed answer to all three questions!
Main Topics
Browse All TopicsAs the 'Navigation Bar' stays the same throughout my Website, I am considering to put its HTML in a separate include file.
EXAMPLE ('navBar.inc.php):
<ul id="nav">
<li><a href+"index.php">Home</a><
<li><a href+"about.htm">About Us</a></li>
<li><a href+"products.htm">Produc
</ul>
Code inserted into HTML document:
<?php include('includes/navBar.i
QUESTIONS:
a) Does this mean that I have to change my 'about.htm' page and 'products.htm' page to 'about.php' and 'products.php' (Note: index.php would stay the same)?
b) Is this good practice? Is this approach professional (to only use '.php -pages' in a Website and not a single '.htm-page')? Or should I use another approach such as <iframe> where 'about.htm' could remain the same?
c) Should I use 'include()' to insert this pure HTML code ( <ul> ... </ul> ) or would it be better to use 'require-once()' ?
Many thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: steelseth12Posted on 2007-12-09 at 04:50:54ID: 20436853
>>a) Does this mean that I have to change my 'about.htm' page and 'products.htm' page to 'about.php' and 'products.php' (Note: index.php would stay the same)?
Yes that would be the best option.
b) Is this good practice? Is this approach professional (to only use '.php -pages' in a Website and not a single '.htm-page')? Or should I use another approach such as <iframe> where 'about.htm' could remain the same?
I havent use .htm pages for over 5 years now. The extension of the page doesnt really matter to anything, as for frames / iframes i never use them.
Include and require_once are basically the same except that with require_once if the file is already included it will not include it again and require / require_once if the fail will result to a Fatal error were include / include_once will only issue a Warning.