Previous Thread
Next Thread
Print Thread
Rate Thread
#291606 09/11/2000 2:54 AM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
NOTE:

In order to use Server Side Includes, your server must be configured to support them. Check with your system administrator as to whether or not you can use them, and if so, what restrictions may be placed on them. If you are not allowed to do SSI- consider moving to someplace where you can!

WHAT IS SSI?

Server Side Includes (SSI) are commands executed by the server as it parses (chops up and looks for special instructions) the HTML file. SSI can be used to include the value of various server environment variables within your HTML such as the local date and time, to add in a footer or header, or embed an executable script. HTML files which contain SSI are often named *.shtml or *.shtm.

Here is basically what happens when your server handles a request for an SSI document:

The server reads the document and parses it for directives (another word for directions). It then follows the instructions that it finds and merges their results into creating a finished document. The document is then sent to the client browser.

If you are really concerned about presenting dynamic content in a uniform manner across most browsers, this method is preferred over "client-side scripting" such as javascript, where there are great variations in how differnt browsers handle the same coding.

Examples:

- Adding Date and Time
To use SSI to place a time and date on the document use the following.


This will place the date and time of the current server location.
This may not be good because the time will conflict with other time zones.
To just display the date without the time, use:




- Include Header/Footer
To add a header and footer to the document, use the following:
At the top of the document:


At the bottom of the document:


To include a file from a different directory, use the following:

At the top of the document:


At the bottom of the document:


You use this type of include if you are using the low-overhead setting for active.cgi:


- Executing a CGI Script
To use SSI to execute a CGI script on the document use the following.


This will execute the cgi script "script.pl"

UBBDev.com uses this method to include active.cgi and slashubb.cgi to their front page:



- note: be sure and use the same general format for your SSI includes found here when you build your own page, including spacing, quotation marks, path to your cgi file, etc...

Warning:

Improper use of SSI may impair server performance as well as server security. Consult with your server administrator before executing Server Side Includes.

Credits:

http://www.bignosebird.com/ssi.shtml (get basics to complex info on SSI here)
http://www.builder.com/Authoring/MoreStupid/ss04.html (good info as well)
(others I can't remember)

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)