Enetica - Australian web hosting and accredited domain name registrar
 
auda accredited domain name registrar nz accredited registrar - new zealand domain names Enetica - Domain Name Registration Australia from Australia's first auDA accredited registrar
Self-Help Knowledgebase


Knowledgebase Home Knowledgebase Home


Search the Knowledgebase Browse by Category
How do I get 'Server Side Includes' to work?
User Opinions
100% 0% (1 vote)

How would you rate this answer?
Helpful
Not helpful

There are many good sites around dedicated to things like SSI so you should search around for detailed information and how-to's. Below is a simple example of how to get SSI working on our servers.



Copy and paste this under your 'public_html' directory and call it test.shtml.


#### start of test.shtml ####

<HTML>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>SSI TEST</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF" marginheight="20" marginwidth="0" leftmargin="0" topmargin="20">
<table border="0" cellpadding="0" cellspacing="0" width="560" align="center">
<tr>
<td align="center">
<p><b>&nbsp; Server Side Includes test &nbsp; </b></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td align="center"> &nbsp;
<!--#exec cgi="/cgi-bin/support-test.cgi"-->
&nbsp; </td>
</tr>
</table>
</body>
</html>

#### end of test.shtml ####


You may have already noticed the '<!--#exec cgi="/cgi-bin/support-test.cgi"-->' line in test.shtml. This line includes a cgi/perl script.

To get this test working we need to create the cgi script under the "cgi-bin" directory so test.shtml can include it.

Copy and paste the follow into the file called “ support-test.cgi” under your “cgi-bin” directory. Remember to set the permissions of support-test.cgi to be executable.


### start support-test.cgi ####

#!/usr/bin/perl
use warnings;
use CGI qw(:standard);

print header(), start_html("test");
print "this is a test";
print end_html();

### end support-test.cgi ####


With both of these files in place you will see that http://www.YOUR-REAL-DOMAIN-HERE.com/test.shtml includes the script in its output displayed on your web browser.

Visitor Comments
No visitor comments posted. Post a comment
Related Questions
No related questions were found.
Attachments
No attachments were found.
1300 720 043 sales@enetica.com.au  Contact Us Help Policy Feedback  
   ©2002-07 Enetica Pty Ltd  ABN 72 924 334 435                                   Link Partners #1                       Link Partners #2     &np;