Executing Files

If you really want to see the power available with SSI, take a look at this section. You can actually use SSI to execute CGI routines! What's so cool about this? Well, the CGI routine can dynamically create HTML code, which is inserted directly in the midst of your page. 

One common use of this form of SSI is for counters and ad rotation scripts. As an example, we have added a simple counter CGI routine. The SSI call is shown below.

<!--#include virtual="/cgi-bin/counter-ssi.cgi" -->

If you look at the source code, you will see code similar to the following:

<IMG SRC="http://www.internet-tips.net/images/Digits/1.gif" Border = "0">
<IMG SRC="http://www.internet-tips.net/images/Digits/6.gif" Border = "0">
<IMG SRC="http://www.internet-tips.net/images/Digits/4.gif" Border = "0"> 

This code has been generated by the CGI routine and automatically inserted into the HTML page.

The "include virtual" is the recommended way to execute a CGI routine in this manner. You can also use the "exec cmd" directive. This appears as shown below.

<!--#exec cmd="/cgi-bin/counter-ssi.cgi" -->

Many servers do not alloy the "exec cmd" directive to be executed at all for security reasons.

Internet Tips Contents
404 Errors Advertising Autoresponse Awardmaster Basics Browsers Careers Chatting Disasters Domains Email Emoticons Ezines Free Stuff Fun Stuff FTP Graphics Homepages HTML Reference HTML Tutorial Interactive Legal Links Msg Boards Microsoft Money Multimedia Networks Newsgroups Newsletter Products RFC's Ringmaster Searches Security Sticky Sites Surfing TANSTAAFL Telnet Viral Webmaster Your System