Reply to Re: Making one HTML page from more than one file

Your name:

Reply:


Posted by Toby A Inkster on 04/23/07 07:30

Manfred Preußig wrote:
> Toby A Inkster schrieb:
>
>> <!--#include "filename.html"-->
>
> This is to the html-file like a comment.

What happens is that the server (assuming it is configured correctly),
sees this "special" comment and strips it out, replacing it with the
contents of "filename.html".

The client browser never sees the comment -- it only sees the replacement.

> Can I include it at every point in the source?

Anywhere you like.

> And what's about the result: It is like the code is in the original
> file?

Precisely.

> What's about the code: Is this included file a complete html-file
> (with html and body-tag and so on?)?

You can include whatever you like in there. But if you include, say,
<html> or <body> then you'll probably end up with an extra set of these
tags in your final document, which is probably not desirable.

> And what's about CSS? Where I have to set the outline? And the
> positions?

If you put this in, say, "navigation.html":

<div id="navigation">
... blah blah blah ...
</div>

Then your file "index.html" might be like this:

<html>
<title>My site.</title>
<style type="text/css">
#navigation { color: orange; }
</style>
<h1>My site.</h1>
<p>Here is some text.</p>
<!--#include "navigation.html"-->
</html>

>> <?php
>> include "filename.html";
>> ?>
>
> Here are the questions the same as above.

Same answers too.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация