Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Include html text in a webpage

Reply
Thread Tools

Include html text in a webpage

 
 
Gregor Traven
Guest
Posts: n/a
 
      10-20-2004
Hi,

I want to include a certain html page or just a piece of html text that is
written in any other file in my html page. How can i do it?

All my html pages have a common header or menu so I want to know how to
include a html text that defines this header or menu in all my html
documents. When I want to update header or menu, i just need to update one
file only.

Thanks for answering

Gregor


 
Reply With Quote
 
 
 
 
Jeffrey Silverman
Guest
Posts: n/a
 
      10-20-2004
On Wed, 20 Oct 2004 18:12:40 +0200, Gregor Traven wrote:

> Hi,
>
> I want to include a certain html page or just a piece of html text that is
> written in any other file in my html page. How can i do it?
>
> All my html pages have a common header or menu so I want to know how to
> include a html text that defines this header or menu in all my html
> documents. When I want to update header or menu, i just need to update one
> file only.
>
> Thanks for answering
>
> Gregor


SSI:
<!--#include filename.html -->

PHP:
<?include("filename.html");?>

ASP:
Uses SSI Syntax

JSP:
Not sure of syntax. It is probably possible, though.

ColdFusion:
Not sure. Can probably use SSI syntax, though.

etc....

--
Jeffrey D. Silverman |
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email

 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      10-20-2004
Gregor Traven wrote:
> All my html pages have a common header or menu so I want to know how to
> include a html text that defines this header or menu in all my html
> documents. When I want to update header or menu, i just need to update one
> file only.


http://allmyfaqs.com/faq.pl?Include_one_file_in_another
 
Reply With Quote
 
Noël®
Guest
Posts: n/a
 
      10-20-2004

> ColdFusion:
> Not sure. Can probably use SSI syntax, though.


<cfinclude template="filename.html">

Noel


 
Reply With Quote
 
Michael Fesser
Guest
Posts: n/a
 
      10-20-2004
.oO(Jeffrey Silverman)

>PHP:
><?include("filename.html");?>


Short open tags are unreliable, so it should be

<?php ... ?>

And JFTR: 'include' doesn't require parentheses, it's no function.

Micha
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-20-2004
In alt.html Michael Fesser said:

> Short open tags are unreliable, so it should be
> <?php ... ?>


URL?


--


v o i c e s
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      10-20-2004
brucie wrote:
> In alt.html Michael Fesser said:


>> Short open tags are unreliable, so it should be
>> <?php ... ?>


> URL?


More precisely, short tags are turned off on some installs of PHP, not least
because they need working around when an XML prolog is used. Its a
configuration option.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-20-2004
In alt.html David Dorward said:

>>> Short open tags are unreliable, so it should be
>>> <?php ... ?>


>> URL?


> More precisely, short tags are turned off on some installs of PHP, not least
> because they need working around when an XML prolog is used.


i thought he was referring to some prase error bug thingy.

> Its a configuration option.


which doesn't make them unreliable.


--


v o i c e s
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      10-20-2004
brucie wrote:

>> Its a configuration option.


> which doesn't make them unreliable.


It does in the sense that if you distribute the script you can't know if it
will work in the target environment.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Michael Fesser
Guest
Posts: n/a
 
      10-20-2004
.oO(brucie)

>In alt.html Michael Fesser said:
>
>> Short open tags are unreliable, so it should be
>> <?php ... ?>

>
>URL?


<http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.phpmode>

"The first way, <?php. . .?>, is the preferred method, as it allows the
use of PHP in XML-conformant code such as XHTML.

The second way is not available always. Short tags are available only
when they have been enabled. This can be done via the short_tags()
function (PHP 3 only), by enabling the short_open_tag configuration
setting in the PHP config file, or by compiling PHP with the
--enable-short-tags option to configure. Even if it is enabled by
default in php.ini-dist, use of short tags are discouraged."

Micha
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What license/copyright text to include and where to include it whenselling a commercial Python based application? Malcolm Greene Python 1 04-16-2010 10:45 PM
Re: What license/copyright text to include and where to include itwhen selling a commercial Python based application? python@bdurham.com Python 0 04-14-2010 03:33 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
check if a webpage is forwarding to a other webpage martijn@gamecreators.nl Python 1 09-06-2005 02:27 PM
include a text file into a webpage Hervé HTML 4 09-30-2003 07:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57