Jump to content

(s)html includes


webjourneyman

Recommended Posts

I've been searching both here and on the net in general about includes. I.e. Inserting a document within another document before it is displayed.I´m interested in this in particular to be able to make global changes to things like header, menubar, footer etc. Without having to do them by hand on each and every page (I´m talking non-database driven website b.t.w.).From what I´ve learned there are two types, server side includes (ssi) and client side includes. It is my understanding that one needs to use javascript to do a client side include and that it is in general a worse methode of doing this than ssi.What is your oppinion on this?Can you give an example of how this is done or better yet a tutorial similar to the ones you already have?Best regards.

Link to comment
Share on other sites

if your server suports php, you can use php includes<?phpinclude('includefile.php');?>where you want the included document to be.and the includefile itself, has to be just plain html, no head, meta, body tags, otherwise the page wont validate. it can be either php, html or htm extension, although if that include file has php code in it, then it has to be php.there is server side includes, but i dont know how they work.asp includes are the same as php includes, except in a different language and the pages need to be .asp and not .php - http://www.w3schools.com/asp/asp_incfiles.aspas for client side includes...not really heard of them in this context before, but there are javascript includes to put in a piece of javascript thats in an external file. And thats not to do with repeating html such as headers, footers, menu's etc...unless they all have the same piece of javascript.hope that helps!:)

Link to comment
Share on other sites

There are the serverside language includes (which can be done in ASP.Net, ASP, PHP, JSP, ColdFusion, etc.), but there is also a way to do it if you're on an Apache server, and you have access to configuration files:Apache SSI HowTo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...