Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Simple HTML query

Thread Tools
 
Search this Thread
 
Old Jul 19, 2003 | 03:33 PM
  #1  
boomer's Avatar
boomer
Thread Starter
Scooby Senior
 
Joined: Feb 2000
Posts: 5,763
Likes: 0
From: West Midlands
Question

Is there an equivalent of a C "#include" in HTML??

Thus i could code something like...

MAIN.HTML
---------
#include "TOP_BIT.HTML"

<p>This is general text, that will be different in various files</p>

#include "BOTTOM_BIT.HTML"
---------

Where TOP_BIT.HTML and BOTTOM_BIT.HTML include the bulk of the code for <HEADER>, </HEADER> etc.

I am not after any smart Java or frame stuff. Just an easy way on including similar code across multiple files.

adTHANKSvance

Cheers,

mb
Reply
Old Jul 19, 2003 | 04:37 PM
  #2  
Chris J's Avatar
Chris J
Scooby Regular
 
Joined: Sep 2001
Posts: 283
Likes: 0
Post

Don't know that much about html, but you could use php to generate the top and bottom bits of the html, but that would probably require some additional work on the servers part.

Isn't there something called style sheets (or there abouts) that can be used to create a template html page?
Reply
Old Jul 19, 2003 | 05:47 PM
  #3  
rik1471's Avatar
rik1471
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
Post

The files will have to be saved with .asp extension, but this should work:

<!--#include file="path to header.htm" -->

<p>This is general text which will be different etc...</p>

<!--#include file="path to footer.htm" -->
Reply
Old Jul 19, 2003 | 05:49 PM
  #4  
Ian Griffiths's Avatar
Ian Griffiths
Scooby Regular
 
Joined: Dec 2000
Posts: 302
Likes: 0
Post

Yes, its called Server Side Include or SSI for short.

Either that or you could do it very easily in PHP or ASP.

You could also possibly do it with Javascript although I wouldn't go that way due to inpredictability with client browsers etc.

Any problems give me a shout.
Reply
Old Jul 21, 2003 | 09:19 AM
  #5  
SJ_Skyline's Avatar
SJ_Skyline
Scooby Senior
 
Joined: Apr 2002
Posts: 21,922
Likes: 2
From: Limbo
Wink

Just as rik1471 says - although you need to be running on NT webspace - sure your hosting company will get pi$$ed off if you try to run asp pages on Linux!
Reply
Old Jul 21, 2003 | 10:11 AM
  #6  
rik1471's Avatar
rik1471
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
Post

Some Linux hosts support ASP.
Reply
Old Jul 21, 2003 | 10:24 AM
  #7  
SJ_Skyline's Avatar
SJ_Skyline
Scooby Senior
 
Joined: Apr 2002
Posts: 21,922
Likes: 2
From: Limbo
Smile

Ours doesn't Had a right mouthfull from some little to$$er saying that I was trying to break their servers!

FFS, we have 2 sites - one as www.domianname.com and one as www1.domianname.com one on NT, one on Linux - easy mistake to upload code to the wrong one! little git accused me of doing it on purpose!

Don't you just love people!
Reply
Old Jul 21, 2003 | 06:23 PM
  #8  
boomer's Avatar
boomer
Thread Starter
Scooby Senior
 
Joined: Feb 2000
Posts: 5,763
Likes: 0
From: West Midlands
Post

Chris J,

i already use Style Sheets (CSS), but that is more for standard layouts, rather than the actual content.

rik1471,

That looks exactly like the kinda thing that i am after, but i'll need to check with my ISP (Demon) that they support ASPs. Trubbul is that i think they use UN*X, so that could be a show stoppa

I am presuming that ASPs are some fancy server-side stuff that pre-processes web pages on the fly to feed "final form" HTML to the client? Is this a MicroSnot (insert sound of Spit The Dog ) only facility?

Ian Griffiths,

I want to keep things as simple as possible. I am surprised that as the Internet was "invented" by sandal-wearing, pony-tailed, UNIX folks, they didn't include the "include" idea from square one. Is it kind of naff (although typical of Microsoft) to "hide" functionality in comments

SJ_Skyline,

time to ask Demon what they support!


Sooooo many options.

Cheers all,

mb
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
Mar 9, 2019 07:35 PM
shorty87
Full Cars Breaking For Spares
19
Dec 22, 2015 11:59 AM
Pro-Line Motorsport
Car Parts For Sale
2
Sep 29, 2015 07:36 PM
ALEXSTI
General Technical
5
Sep 28, 2015 09:29 PM
Ozne
General Technical
2
Sep 27, 2015 03:06 PM




All times are GMT +1. The time now is 04:21 AM.