Simple HTML query
#1
Scooby Senior
Thread Starter
Join Date: Feb 2000
Location: West Midlands
Posts: 5,763
Likes: 0
Received 0 Likes
on
0 Posts
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
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
#2
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?
Isn't there something called style sheets (or there abouts) that can be used to create a template html page?
#3
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" -->
<!--#include file="path to header.htm" -->
<p>This is general text which will be different etc...</p>
<!--#include file="path to footer.htm" -->
#4
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.
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.
#7
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!
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!
Trending Topics
#8
Scooby Senior
Thread Starter
Join Date: Feb 2000
Location: West Midlands
Posts: 5,763
Likes: 0
Received 0 Likes
on
0 Posts
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
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
Thread
Thread Starter
Forum
Replies
Last Post
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