Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 612775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:55:46+00:00 2026-05-13T17:55:46+00:00

i’m new to web developement and i have a problem .. and a (bad)

  • 0

i’m new to web developement and i have a problem .. and a (bad) solution :
i want to navigate in my page. The pages have the same layout. The only difference is an div container.
Sample code :
home.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en >
<head>
<title>Sample</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="container" >
    <div id="outer" >
        <div id="inner">
            <div id="left" >
            <div id="menu3">
        <ul>

            <li><a href="home.html" title="Link 1">Home</a></li>
            <li><a href="about.html" title="Link 2">About</a></li>
        </ul>
</div>

        </div>
        <div id="content" ><h2>Startseite</h2>
        <p>
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
        </p>
        </div><!-- end content -->
        </div><!-- end inner -->
    </div><!-- end outer -->
</div><!-- end container -->
</body>
</html>

about.html:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en >
<head>
<title>Sample</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
<div id="container" >
    <div id="outer" >
        <div id="inner">
            <div id="left" >
            <div id="menu3">
        <ul>

            <li><a href="home.html" title="Link 1">Home</a></li>
            <li><a href="about.html" title="Link 2">About</a></li>
        </ul>
</div>

        </div>
        <div id="content" ><h2>Startseite</h2>
        <p>
              **OTHER CONTENT**
        </p>
        </div><!-- end content -->
        </div><!-- end inner -->
    </div><!-- end outer -->
</div><!-- end container -->
</body>
</html>

This works fine.
But there is a lot of code duplication which can get me into trouble when i have 15 pages 😀
So.. what is the usual way to do it ?
Maybe some Ajax voodo ?!

Please Help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:55:46+00:00Added an answer on May 13, 2026 at 5:55 pm

    Use Server Side Includes (SSI)

    There is no need to install additional software on your server if you do not need all its functionality. PHP doesn’t come standard with any web-server.

    Personally, using PHP to reduce HTML-repetition is the equivalent of shooting down a mosquito with a M198 howitzer.

    On the other hand, SSI is supported in the two most widely use web-server software (Apache, IIS) and its usage is rather simple.

    Simply use the extension .shtml or .shtm for your file. Put your comment contents in separate files, and then, in your page file, use the following to include the different parts:

    <!--#include virtual="common/header.part.shtm" -->
    <h2>Startseite</h2>
    <p>
       **OTHER CONTENT**
    </p>
    <!--#include virtual="common/footer.part.shtm" -->
    

    Again, this is supported by all major web-server software available and requires no additional CGI modules to be installed, unlike PHP.

    Note: Apache requires mod_include to be enabled on the web-server. Its binaries are included in every binary Apache distribution.


    You definitely do not want to use AJAX for a situation like this for the following reasons:

    1. Your page will be unreadable for people using browsers without JavaScript support (embedded devices, desktop computers in high-security workplaces, etc.)
    2. Search engines cannot (as of yet) interpret JavaScript DOM changes properly and won’t be able to crawl your pages properly.

    SSI is the simplest way of doing this server-side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 342k
  • Answers 342k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer char *strtok(char *str, const char *delim); (from man pages) The… May 14, 2026 at 5:16 am
  • Editorial Team
    Editorial Team added an answer It depends on what you want to do. Java2D is… May 14, 2026 at 5:16 am
  • Editorial Team
    Editorial Team added an answer Well, you could retrieve the value every time you load… May 14, 2026 at 5:16 am

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I've got a string that has curly quotes in it. I'd like to replace
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.