Go Back   DN Lodge Webmaster Forums > Web Design and Development > Web Development Discussion


Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 09-25-06, 09:30 PM
Geoserv's Avatar
Co-Admin
DNLodge Staff
Recent Blog: HostingCon 2009
 
Join Date: May 2006
Location: Nova Scotia, Canada
Posts: 2,133
DNL Trust: (0)
Geoserv has a helpful personalityGeoserv has a helpful personality
Default How do I include a file using ServerSide Includes?

You need to have the main file index.shtml in the shtml extension. Then on the files you include you don't need the <html><body> tags. The Menu file can be any extension you want, but normally .txt, but can be .php or .htm/,html/.shtml.

For example:

index.shtml

<html>
<head>
<title>SSI Example</title>
</head>
<body>

<!--#include virtual="header.txt" -->


<p> Information about the website.</p>


<p> <!--#include virtual="footer.txt" --> </p>

</body>
</html>

header.txt

<img src="header.jpg" alt="Header Image" width="595" height="74" />
<br>
<a href="index.shtml">Home</a> | <a href="example.shtml">Example Page</a> | <a href="header.txt">View Header</a> | <a href="footer.txt">View Footer</a>

footer.txt

<hr>
<img src="utchome.gif" width="75" height="79" align="top"> <em>Footer Information. Last modified:date here</em>

Hopefully this example helps you understand how SSI works. Although .txt is one of the most common methods, .php is the most recommended.

The syntax for a PHP include is:

<? include('/directory/file.php'); ?>

You will need to have .php as your page extension.

For example:

index.php

<html>
<head>
<title>SSI Example</title>
</head>
<body>

<? include('/directory/header.php'); ?>


<p> Information about the website.</p>


<p> <? include('/directory/footer.php'); ?> </p>

</body>
</html>

You can include files with .php, .html, .txt and other extension.

The final page must have a .php extension.

Again, you should strip out everything except the actual content you wish to include.

Good luck,
Geoserv.
__________________
Latest Web Launches: Get In On! - Brand NEW!
Join me at - Second Brain
Top Stumbles |News Dots |APNAOnline | Utopian Productions |Pliggs |DIY Pad
|FAQ Pal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Want to remove these ads? Register for your free account here.

  #2  
Old 09-26-06, 12:47 AM
Nigel Lew's Avatar
DNL Supporter
 
Join Date: Jun 2006
Location: Carbondale,Colorado
Posts: 363
DNL Trust: (0)
Send a message via MSN to Nigel Lew
Nigel Lew is a pretty decent person
Default Re: How do I include a file using ServerSide Includes?

stolen info again.....I am sorry but this info is readily available from the person who wrote it...



I can pass this link well but the owner just said no.......
Nigel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 09-26-06, 06:13 AM
Geoserv's Avatar
Co-Admin
DNLodge Staff
Recent Blog: HostingCon 2009
 
Join Date: May 2006
Location: Nova Scotia, Canada
Posts: 2,133
DNL Trust: (0)
Geoserv has a helpful personalityGeoserv has a helpful personality
Default Re: How do I include a file using ServerSide Includes?

Excuse me.

How can a simple FAQ like this be stolen?

Geoserv.
__________________
Latest Web Launches: Get In On! - Brand NEW!
Join me at - Second Brain
Top Stumbles |News Dots |APNAOnline | Utopian Productions |Pliggs |DIY Pad
|FAQ Pal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
file, include, includes, serverside


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Domains For Sale EJRS.COM Sites & Domains For Sale 2 09-26-06 11:38 AM
I can't open my data file as I tested file does not exists Jax Web Design Discussion 1 08-24-06 03:53 PM
PHP file sending script needed! UndergroundMark Trade Services or Hire 5 02-22-06 08:54 PM
Free File Hosting extreme90 Site Advertising 0 01-16-06 04:00 AM
Multimedia in your pages.... UndergroundMark Web Development Discussion 0 11-24-05 07:32 PM


All times are GMT -5. The time now is 07:12 PM.



Copyright © 2005-2009 DNLodge.com.
vBulletin, © 2000-2009, Jelsoft Enterprises Limited.
SEO by vBSEO.
Advertising |  About Us |  Contact Us |  RSS |  Privacy Policy |  Back to Top