HTML
  Home arrow HTML arrow Page 6 - Using SSI to Boost Efficiency
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Using SSI to Boost Efficiency
By: Clay Dowling
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 7
    2004-08-16

    Table of Contents:
  • Using SSI to Boost Efficiency
  • Enabling SSI
  • Simple SSI Directives
  • How to Use SSI
  • Navigation Menus
  • Common HTML Blocks
  • Business Considerations

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using SSI to Boost Efficiency - Common HTML Blocks


    (Page 6 of 7 )

    There are blocks of common code I have used on my website. Support for many of my downloadable scripts can be purchased through PayPal. Likewise, these scripts are listed on script sites that have a rating system. The code blocks for both are a little tedious and very similar across all pages.

    Part of the problem here is that the blocks are similar, not identical. For IIS users, this means you're out of luck.  For Apache users though, the combination of #set and #echo directives are useful. The block for the script rating site is below:

    <!-- Script ranking block -->
    <form action="
    http://www.scripts.tld/cgi-bin/rate.cgi" method="POST">
    <input type="hidden" name="ID" value="20656">
    <table BORDER="0" CELLSPACING="0" bgcolor="#800000"><tr><td>
    <table border="0" cellspacing="0" width="100%" bgcolor="#EFEFEF" cellpadding="3"><tr><td align="center">
    <font face="arial, verdana" size="2"><b>Rate Our Script</b></font></td>
    <td align="center">
    <select name="ex_rate" size="1">
     <option selected>Select</option>
     <option value="5">Excellent!</option>
     <option value="4">Very Good</option>
     <option value="3">Good</option>
     <option value="2">Fair</option>
     <option value="1">Poor</option>
    </select>
    </td>
    <td align="center"><input type="submit" value="Go!"></td>
    </tr></table>
    </td></tr></table>
    </form>

    <!-- End of Script Ranking Block -->

    The only part I'm really worried about here is the value of the ID form field.  That is the only part that will change from page to page.  Again, I cut the block of code out of my page and drop it into its own file, which I'll call "rateblock.shtml".  I replace the value of the ID field with an #echo directive, as demonstrated below in the code excerpt.

    <!-- Automated Script Ranking Block -->
    <form action="
    http://www.scripts.tld/cgi-bin/rate.cgi" method="POST">
    <input type="hidden" name="ID" value='<!--#echo var="SCRIPT_ID" -->'>
    ....

    Now to put a rating block on one of my pages, I need a pair of directives in my page:

    <!--#set var="SCRIPT_ID" value="12345" -->
    <!--#include virtual="rateblock.shtml" -->

    The block will appear in my pages with the proper value in the ID field. If you get a value of "(none)" in the ID field, you have a mismatch between the variable you set in your page and the value you are echoing in the included file. I lost several minutes trying to resolve that problem.

    More HTML Articles
    More By Clay Dowling


     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT