web page template tips: php vs. ssi and "div" vs. "p"

The Kwik-n-free web page template uses PHP not SSI, and often suggests <div> codes without <p>. Thursday, July 29. Last edited: 2008.01.12


Warning: include(../template/related-pages.inc) [function.include]: failed to open stream: No such file or directory in /home/knf/public_html/web-design/tips/php-vs-ssi.php on line 51

Warning: include() [function.include]: Failed opening '../template/related-pages.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/knf/public_html/web-design/tips/php-vs-ssi.php on line 51

Here is why I am using PHP includes and not SSI or FrontPage includes for the navigation links, email address, copyright, etc.

As soon as your web site has three pages, and plans a fourth, you realize that you would rather "include" the same new navigation links on all pages without editing all pages. Both PHP and SSI includes are equally fast and reliable, and need no learning. For both, you simply paste in a gibbery bit of script, and adjust the URL to whatever file you want to "include."
  • SSI include call: <!--#include virtual="/head.htm" -->
  • PHP include call: <?php include("../../head.inc"); ?>
For some time, I was determined to stay with SSI, which I happened to learn first. PHP however offers anything that SSI can do, plus an unlimited supply of free and cheap scripts. Therefore, PHP is preferred by most experts, and does just as well for the beginner.

SSI and PHP probably are superior to "FrontPage includes" and similar software-dependent methods.

The last I read, people with large websites were advised by FrontPage instructions not to use FrontPage includes, but to change to SSI or PHP. This indicates low efficiency, as well as a dependence on an expensive software product. Other high-end software products, such as Dreamweaver, possibly can edit the links sections of multiple pages with a single action. If so, this might be perfectly efficient. However, this again requires learning to use a specific product, and a dependence on it. I do recommend the occasional use of automatic web design software for convenience. However, using my SSI template system:
  • You can use any software product according to your budget.
  • You can change software whenever you find a better one.
  • Only Notepad is really needed.

Using a PHP Editor or a free desktop web site server.

Unless you have an expensive program such as Dreamweaver, it is necessary to upload to a web hosting server for the "server side" part of the "server side includes." However, with PHP, a free "PHP Editor" program might allow you to see the fully "included" file offline. (See "The Tiger Guide to PHP Editors.") However, for SSI as well as PHP, the ideal solution is a "personal web server" installed on your desktop. An Apache.org web server is the popular standard and can be downloaded free. However, if you are not actually hosting a website (and perhaps even if you are) I would suggest an Aprelium.com web server. This is also free, has a smaller download, and reportedly is quite easy to set up.

Why instead of <p> tags, I often use <div> tags with the first sentence styled as an "inline" <h4> subheading.

My template's CSS specifies that any <div> tag will create a line space and indent the first word, just like a <p> tag, unless otherwise specified. Please note that this requires margins to be specified in the CSS wherever <div> tags are used. (You can of course change all this if you wish.)

The idea is to create web pages that can quickly be summarized, just by reading the first sentence of each paragraph.

The use of <h4> tags for these first sentences--rather than simply tagging the first sentence as "bold" or "strong"--flags the search engines that "important words and phrases summarizing this page probably can be found here." Thus, by replacing the usual <p> tag with <div> and <h4> tags, I hope to encourage page construction that automatically tends to be search friendly, as well as in good journalistic style.

My "inline <h4>" style can make for a well-written web page, by both literary and technical standards.

The writer is encouraged to ask, "What exactly am I saying in this paragraph, as best summarized in one sentence?" Writers often find that the last sentence of a paragraph tends to be a summary. If so, this might well be moved to the front of the paragraph into the <h4> code tags. At other times, you as a writer might find that you are rambling, and never even coming to the point. The idea to "ask yourself exactly what you are saying, and make that the first sentence," is an old journalistic technique. Placing this same summary into <h4> code tags makes it very search friendly. This of course is not the only way to write, but for web pages, is especially practical.

When there are several related <h4> sentences, the first <h4> can become an <h3>.

Just as the <h4> sentence summarizes the sentences that follow within a paragraph--an <h3> sentence can summarize several paragraphs. The <h3> heading is then given a distinctive formatting. On this page, I have given the <h3> headings a large, fancy type face and distinctive background. This helps to recognize when several paragraphs are focused on the same theme. To keep your website fresh and unique, all font styles and backgrounds can of course instantly be changed using the CSS, as often as desired.


Warning: include(../template/related-pages.inc) [function.include]: failed to open stream: No such file or directory in /home/knf/public_html/web-design/tips/php-vs-ssi.php on line 95

Warning: include() [function.include]: Failed opening '../template/related-pages.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/knf/public_html/web-design/tips/php-vs-ssi.php on line 95

                                                                                                   
 
Thank you for visiting the web page template tips page. (PHP vs. SSI & <div> vs. <p>)