|
|
|
Contributing MyRival Team members:
Jordan Firechild, Jaala Robinson, Phzzz
Page layout and design by:
Phzzz
This site is hosted by RedRival.com, the free web-hosting service that makes it all possible!
|
|
|
The Unofficial RedRival Support Site at MyRival Using SSI (Server Side Includes)
|
SSI is an excellent function to use on your site, and is supported by RedRival.
- What is SSI?
SSI stands for Server-Side Includes. They can be used in many ways, such as putting a menu bar on every page of your site (thus not needing a separate frame for it), placing banners and such on your site, showing the date/time the page was last updated, etc. The basic layout of this site you're looking at now uses SSI in these ways. The top of this page, the menu bar on the left, the "last updated" line at the bottom of the page, etc... All are done using SSI.
A more detailed look at SSI can be found at BigNoseBird.com.
- How to use SSI
To put an SSI on your page, you must change the end of your file name to .shtml at this time. RR tried fixing things so you didn't have to do this, but it didn't seem to work. Using SSI on .htm or .html files may become available in the future.
Calls to SSI are done with one simple line in your HTML that looks something like this:
<!--#echo var="DATE_LOCAL" -->
This particular line will tell RedRival's server to include the local time at that particular place in your HTML. Here is a working example of that code:
Monday, 06-Oct-2008 21:13:15 EDT
The server will send the full HTML including everything called by SSI to the site viewer. The viewer will not see the actual SSI call line if they view the source of the page.
For example, if you view the source of this webpage, you will not be able to see that there were at least six SSI calls used.
One noticeable method of using an SSI is the code you can use to include a voluntary RR banner ad on your site.
- Including HTML or text in your page
You can use an SSI to call another file that has a snippet of HTML or text in it. This is useful if you have a certain HTML code or text on every page of your site, and it might be changed in the future.
For example, the Site Menu on the left side of every page on this site is actually a snippet of HTML code put in a separate file, and called in using an SSI. That way, if we add a page to the site, we go in and change that one snippet of code, and it automatically changes on every page. Convenience without resorting to frames!
The code you would use to include text or HTML would look like this:
<!--#include virtual="menu.html" -->
In the file menu.html in the example above, you should have a snippet of HTML code that contains only the code necessary to make the menu bar on your site, if that's what you're using it for. In virtual=, you can specify where the file is located in the same way as if it were in an href=, i.e. "../directory/menu.html" or "/username/directory/menu.html".
YOU CANNOT call code that is placed on a server other than RedRival. In other words, virtual="http://www.anothersite.com/menu.html" won't work!
The uses of this SSI "include" call are limited only to your imagination.
- Special Functions
Here are a few special features you can use on your site that are provided through using SSI:
- Date page last updated
<!--#echo var="LAST_MODIFIED" -->
The above code will show the date/time the page was last modified. It shows RR's server's time, which is EST. You can see an example of this in action at the very bottom of this and every page on this site.
- Local Time
<!--#echo var="DATE_LOCAL" -->
This will show the (RR Server's) local time, which at the moment you downloaded this page was Monday, 06-Oct-2008 21:13:15 EDT.
- Create a real "Back" button
<!--#echo var="HTTP_REFERER" -->
The above line of code shows the last page the user was on before they came to this page, IF they didn't type in the exact URL to this page. If you clicked a link to come here, then you should see a blue line below that shows where you clicked the link:
(none)
Now, the person reading your site already knows where they came from, so showing them that would kinda be pointless, right? The only purpose in it would be to show how this particular SSI works.
You can use this call to create a "Back" button, though! Simply place the call in your href= statement between the quotation marks, like so:
<a href="<!--#echo var="HTTP_REFERER" -->">Go Back</a>
Here's a working link using the above code... Go Back
That simple! But of course, as stated before, the above link won't work unless they clicked a link to come to your page.
- Other "echo" call uses
There are several other things you can do with the SSI "echo" call, such as those above. You can read about these at BigNoseBird.com.
|
|
Random Quote
|
The kindest acts of the wicked are cruel.
-- Proverbs 12:10 --
|
| |
|
|
©
Copyright 1999 - 2002,
Last Updated On: Thursday, 17-May-2007 21:19:34 EDT All rights reserved.
* MyRival.com is a RedRival owned site and domain, operated by RedRival members
Webmastering, Site Design and Layout by Web Design by Phzzz
Background images provided by
Web Design by Phzzz
and Le Pinceau Web Graphics
All material contained on these pages is © RedRival members
No material from this site may be reproduced or copied without express written permission of the
MYRIVAL TEAM.
|
|
|