|
Server side includes are just that...server side helps. They are things your server can do to make life easier...you can call up the time with SSI and the date, you can use it to perform a cgi function like count your hits, and you can have code on your page that is not on your page. This is extremely useful when it comes to tableart and audioscopes where files can be huge; so that's what we'll cover here.
Basically you make an extra web page with some of your tables, scopes, data, whatever. This page should contain ONLY the code for your include...NO <html> NO background tag, nothing....just the raw code...
Here's the page for my tree example.
Now how do you get that code on your page...without putting it on your page...say WHAT? That's what SSI does.
Your main html page is where you put the order to the server. Yep that's right, you tell the server "Go and get this and put it right here."
It's called a command and it's written like this: <!--#include virtual="/tut/TTT2/SSITREE.html" --> . NOTE:There is a space between the last quotes and the dash.
That command is your code in essence...wherever you put that command is where your include will show on the page. It can be on the page by itself; it can be inside a table or a table cell if you want, it can be put in CSS divs and placed on the page that way; it does not matter. You can also use it many times on the same page or on different pages once or many times. You can even use it with DHTML and move it.This page has five trees..
TREES
Here's how they are coded on the page....or source it if you like.
These two are regular CSS divs.
<div id="one"><!--#include virtual="/tut/TTT2/SSITREE.html" --></div>
<div id="two"><!--#include virtual="/tut/TTT2/SSITREE.html" --></div>
These two are in a table, each in its own td cell
<div id="three"><table border="0"cellpadding ="40"><tr><td><!--#include virtual="/tut/TTT2/SSITREE.html" --></td><td><!--#include virtual="/tut/TTT2/SSITREE.html" --></td></tr></table></div>
This one is a simple block spacer placement. Remember if you are using this for something you want a PC to view...do not use block spacers.
<spacer type="block" h="310"width="150">
<!--#include virtual="/tut/TTT2/SSITREE.html" -->
< br />
Not all servers are created equal. On some servers you may have to use dot shtml as your extension to tell your server..."Hey guy...SSI over here!".
Try it with the regular html extension and if it does not work change it to shtml.
Note for those at Arbor Hosting...you may either use the shtml extension or make your file CHMOD755
SSI is NOT viewable in preview. Use save and view or save. Then view it for correct placement. And return to edit.
+ Big Nosed Bird
+ I.U. Webmaster
|