Forum Moderators: open

Message Too Old, No Replies

Ssi

A client side alternative to SSI

         

steelegbr

9:04 am on Jul 28, 2004 (gmt 0)

10+ Year Member



One of my sites is becoming larger than I first planned and I wish to add more content to all of the pages at the same time. My first idea was to use SSI but the server doesn't allow ANY server side scripts at all so I am looking for an alternative but client side, to SSI.

Any ideas?

BlobFisk

10:29 am on Jul 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SSI is the best way of doing this however there are a couple of alternatives - neither of which are any way as good as SSI:

iFrames:
You can use an iFrame in the area that is common to your site. These are fairly well supported these days and changing the iFrame source page will be reflected site wise.

On the downside it makes (for example) coding a nav bar a little more work as you need to assign a target attribute to all links and it's a different docunent.

JavaScript include:
Really a last ditch resort! You can include a .js file as your common include. The JS file will do a series of document.writes and write your content. Updating this file will be reflected sitewide.

On the downside people with JS turned off will see nothing. It's not really SE friendly and there is a lot of work and hassle involved in writing HTML through JS. It's not what it was designed to do and there is a little extra overhead for the client to churn throuhg the JS.

Ideally you should ask your hosting service if you can have an SSI!

HTH

encyclo

10:54 am on Jul 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As BlobFisk says, there are alternatives to SSI, but none are as good.

The real solution in your case is to change to another hosting company. These days, it is impossible to run anything other than a very simple site without access to SSI or server-side scripting languages such as PHP. Only proper hosting will give you the control you need to make the site successful.

steelegbr

5:40 pm on Jul 28, 2004 (gmt 0)

10+ Year Member



The server I am with is my internet provider company and their excuse for no server sides is that it has been "missused in the past".

My site on free webspace and if anyone could let me know of a good free web host with a server side language (I know ASP but am willing to learn others) that I could transfer to, please sticky mail me but they must allow downloads (the reason I use who I'm with) as I have a freeware program.

encyclo

5:46 pm on Jul 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



a good free web host with a server side language

There aren't any. But there are a million hosting plans available at less than $10 a month which offer everything you need and are 100 times better than any free host. If you have good visitor numbers, run a few unobtrusive Adsense ads and you'll probably cover your hosting cost with a little profit left over.

As I said, you can't run a serious website without the right tools - server-side languages, full statistics package and the rest - and you can't do any of that on a free web host.

steelegbr

5:57 pm on Jul 28, 2004 (gmt 0)

10+ Year Member



To be honest, the site this concerns only gets one or two visitors a day so not really worth £10 a month.

vkaryl

6:11 pm on Jul 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can rename your html pages .php, then use an include to pull regular html pages into the coded area. It's very like ssi, but client side instead, and as far as I know practically all hosts have no problem with it.

<?php include "*.html";?> where you want the info to reside. (I'm at work, I THINK I got the code string right, but you might just search WebmasterWorld for "php includes" to make sure....)

BlobFisk

8:59 am on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That looks like a server side include to me vkaryl. The server parses the php file and includes all files before sending it to the client.

All server side languages have and include command and they all get parsed at the server rather than the client. For this to happen client side you would need to send the file (to be included) with the HTTP steam.

vkaryl

6:08 pm on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi BlobFisk -

My misunderstanding! Can't remember what I read where, but something made me think that php includes must be client side.... or perhaps it's because my host disallows SSI but hasn't a problem with php includes....

Thanks!