Ezilon.com - Target Your Audience, be Seen in Your Region

My First SSI - Worked! But Did I Do It Right?

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.
Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

I just did my first include and it worked. I'm just wondering if I did it right?

I just renamed an html file index.inc and uploaded it
Then called it into an .shtml page like this:

Is this right? Does there have to be an .inc file?

She has: 113 posts

Joined: Oct 2000

Roo, I have used ssi on many of my sites.
I name the file to be included with a .shtml
(yes just like the one calling it)
I haven't as yet had any problems with that.
I generally don't call a whole page into another though,
just parts of one.

~bobbi

"Nothing worth having comes without some kind of fight- 'Got to kick at the darkness 'til it bleeds daylight." - Bruce Cockburn

Suzanne's picture

She has: 5,512 posts

Joined: Feb 2000

.inc or .txt or .html or .shtml -- it only needs to be .shtml if the included file contains further scripting.

If it works, hon, it's right. If it's not right, it won't work, period. Wink

Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

Whew! I've read so many things and some say .inc, and others say you can call other files. I've got the big fat black book in front of me now....it was sitting here staring at me, but I wasn't seeing it. Smiling

I was using a whole page for my custom error pages. Using the same one for everything until I actually get the site done.

andy206uk's picture
DeveloperModerator

He has: 1,754 posts

Joined: Jul 2002

Just a tip for you. If you have a page that has for instance a menu include and includes for headers and footers, precede the names with an "_" this will ensure they always show at the top of alphabeticlly file lists and stand out from your normal pages. ie:

_header.shtml
_footer.shtml
_menu.shtml

Smiling

Andyk

Blog of a Web Designer
Give a man a fish and you feed him for a day. Teach him to use the Net and he won't bother you for weeks.

He has: 154 posts

Joined: Jun 2004

HOw do you call the menu , footer , header on to a page plz Laughing out loud

Suzanne's picture

She has: 5,512 posts

Joined: Feb 2000

As Bobbi said, as well -- make sure that your includes are not whole pages like with frames, but rather pieces only, like a single div that contains all the content or the navigation, et cetera.

Roo's picture
Developer

She has: 836 posts

Joined: Apr 1999

Yeah I'm going to try using it to assemble a page with, so the tips are good! This first one was for my custom error pages. I wanted something, but until I settle on a new deisgn I'm using the same file for all of them.

Saurons:
I think...(and mind you I'm new with includes) that you'd just put

Or

In the area where you want to include these things. I'll be playing with this tomorrow....my freinds son is graduating in a few hours!

He has: 19 posts

Joined: Jun 2004

If you really need to include many files, it may be worth while to learn a little PHP.

With SSI you have:

<html>
<head></head>
<body>
<!--#include virtual="FILE.ext"-->
</body>
</html>

With PHP you have:

<?php
include('file.ext');
?>

If you need any PHP programming don't hesitate to shoot me an email or PM me here at Webmaster-Forums!

[EMAIL] [PM]

She has: 113 posts

Joined: Oct 2000

http://bignosebird.com/ssi.shtml

I break my sites down into sections of code:
meta.shtml
header.shtml
navtop.shtml
ect.

You can break it up any way you want.

I had 2 different places bookmarked that had great easy to understand tuts on SSI's, but they are both gone now.
I think I have the web pages archived somewhere and will try to dig them.

I am assuming php works about the same way,
I haven't tried that route yet, but may experiment a bit this summer.

~bobbi

"Nothing worth having comes without some kind of fight- 'Got to kick at the darkness 'til it bleeds daylight." - Bruce Cockburn

Subscribe to this feed: Syndicate content