Forum Moderators: coopster & phranque

Message Too Old, No Replies

Static pages vs CGI

         

drhowarddrfine

8:23 pm on Aug 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have an ordering system with a main "menu". You can select from one of eight ordering categories. My indecision is based on the fact that each category page is identical except for its main content, the product.

I could create eight different static pages "enhanced" with perl OR I can create one perl program to create the eight different pages.

I just feel fiunny about having eight pages of nearly identical html code but I also dread having to write a lot of if/else/print decision logic to generate different prints based on which page I'm on.

Is this just a matter of personal preference, philosophy, or am I missing something?

MichaelBluejay

10:22 am on Aug 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd say it's a matter of personal preference. But there are other options anyway. You can create boilerplate HTML with SSI, so you don't have to write the same code over and over again. Here's the crash course.

(1) If you don't have a file called .htaccess at the top level of your site (the same level as index.html) then create one.

(2) If your .htaccess file doesn't have the following code, then add it:

AddHandler server-parsed .html

(3) Create a file of the code you want to insert. It doesn't matter what the extension is. Most people use .html but I tend to use .ssi. For example, standard.ssi could contain

<P><B>Please select a category....</B>
<BR><A href="books.html">Books</A>
<BR><A href="weapons.html">Weapons</A>
...

(4) To pull in that SSI, put this in your <HTML> page:

<HTML><BODY>
<!--#include virtual="standard.ssi"-->
<P>Blah blah blah