minitutorials main logo the place to learn online

Sponsor This Site!
Sponsorship Details - miniTutorials is taking enquiries into various Sponsorship opportunities. Available NOW! Read More on our Sponsorship page.
Discussion Forums
visit the mini tutorial forums
For expert help and advice on any of our Tutorials or anything else .... visit the forums and ask away!!

Last Five Posts :-


Warning: include() [function.include]: open_basedir restriction in effect. File(/var/virtual/web/w1785/cgi-bin/db.php) is not within the allowed path(s): (/var/kunden/webs/w0003/:/tmp/:/var/www/syscp/:/var/www/roundcubemail-0.2-beta/:/usr/share/phpmyadmin/:/etc/phpmyadmin/:/dev/:/var/kunden/webs/:/var/lib/php5/:/etc/apache2/sites-enabled/) in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: include(/var/virtual/web/w1785/cgi-bin/db.php) [function.include]: failed to open stream: Operation not permitted in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: include() [function.include]: Failed opening '/var/virtual/web/w1785/cgi-bin/db.php' for inclusion (include_path='.:/usr/share/php:/usr/bin') in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 21

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 24

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/kunden/webs/w0003/archives/rightbar_archives.ssi on line 27
Click on a Topic Title
Google Ads

Web Design

Server Side Includes

Beginners Level

SSI Demo Notes Page

design tutorials graphic

A simple Server Side Include Demonstration
(How to include the contents of a seperate file into all your web pages)

Notes Page

[Use the Back Button to return to ssidemo page]


Notes


Note1 -

menu.txt is an arbitary name I have chosen for this example. If you use Dreamweaver for instance and wish to use it to edit these external text documents then an alternative extension of .ssi might be more appropriate (menu.ssi) will be recognised as a Dreamweaver associated file, and will work just as well.

Note2 -

Placing the file in the site root means you don't have to worry about specifing long path names.
Any .shtml files already in your site root need only specify "menu.txt" in the include statement.
Any .shtml files nested in sub directories of your site need only specify "/menu.txt" in the include statement.

Note3 -

It is important (unless you can configure your server otherwise) that all files you wish to use SSI directives with are given the .shtml or .shtm extension in place of the usual .html or .htm .
Web Servers are (by default) set up to look for SSI directives only in files with these extensions.
Ordinary .html or .htm files are no different in reality but are not searched by the server for SSI directives. Therefore they will not get processed (eben if they contain any).
The main reason for this is so the server only searches file types it knows might contain these directives - searching every single .html file in your site is a waste of time and resources, also slowing the load times of your web pages.

Note4 -

If you place your menu.txt file in a sub directory (/scripts/ssi/ for example) then you will need to reflect this in your include statement. Using my example above the statement changes to :-

<!--#include virtual="/scripts/ssi/menu.txt" -->

It is in my opinion then that you place your menu.txt in the site root instead (See also [ Note2 ])

 


tutorial sponsors logo

About Us | Site Map | Privacy Policy | Accessibility |Contact Us | ©2003 - 2007 miniTutorials.com