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 19 July 2003, 03:33 PM
  #1  
boomer
Scooby Senior
Thread Starter
 
boomer's Avatar
 
Join Date: Feb 2000
Location: West Midlands
Posts: 5,763
Likes: 0
Received 0 Likes on 0 Posts
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
Old 19 July 2003, 04:37 PM
  #2  
Chris J
Scooby Regular
 
Chris J's Avatar
 
Join Date: Sep 2001
Posts: 283
Likes: 0
Received 0 Likes on 0 Posts
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?
Old 19 July 2003, 05:47 PM
  #3  
rik1471
Scooby Regular
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
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" -->
Old 19 July 2003, 05:49 PM
  #4  
Ian Griffiths
Scooby Regular
 
Ian Griffiths's Avatar
 
Join Date: Dec 2000
Posts: 302
Likes: 0
Received 0 Likes on 0 Posts
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.
Old 21 July 2003, 09:19 AM
  #5  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
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!
Old 21 July 2003, 10:11 AM
  #6  
rik1471
Scooby Regular
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

Some Linux hosts support ASP.
Old 21 July 2003, 10:24 AM
  #7  
SJ_Skyline
Scooby Senior
 
SJ_Skyline's Avatar
 
Join Date: Apr 2002
Location: Limbo
Posts: 21,922
Likes: 0
Received 1 Like on 1 Post
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!
Old 21 July 2003, 06:23 PM
  #8  
boomer
Scooby Senior
Thread Starter
 
boomer's Avatar
 
Join Date: Feb 2000
Location: West Midlands
Posts: 5,763
Likes: 0
Received 0 Likes on 0 Posts
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
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Frizzle-Dee
Essex Subaru Owners Club
13
09 March 2019 07:35 PM
shorty87
Full Cars Breaking For Spares
19
22 December 2015 11:59 AM
Pro-Line Motorsport
Car Parts For Sale
2
29 September 2015 07:36 PM
ALEXSTI
General Technical
5
28 September 2015 09:29 PM
Ozne
General Technical
2
27 September 2015 03:06 PM



Quick Reply: Simple HTML query



All times are GMT +1. The time now is 09:28 PM.