My First SSI - Worked! But Did I Do It Right?
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?
Roo
dragonsjaw posted this at 02:54 — 18th June 2004.
She has: 120 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 posted this at 04:13 — 18th June 2004.
She has: 5,507 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.
Roo posted this at 04:41 — 18th June 2004.
She has: 840 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.
I was using a whole page for my custom error pages. Using the same one for everything until I actually get the site done.
Roo
andy206uk posted this at 10:21 — 18th June 2004.
He has: 1,758 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
Andy
modulargaming posted this at 14:28 — 18th June 2004.
He has: 152 posts
Joined: Jun 2004
HOw do you call the menu , footer , header on to a page plz
Suzanne posted this at 15:34 — 18th June 2004.
She has: 5,507 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 posted this at 18:30 — 18th June 2004.
She has: 840 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!
Roo
ShawnK posted this at 18:38 — 18th June 2004.
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]
dragonsjaw posted this at 19:42 — 18th June 2004.
She has: 120 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
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.