概要:
什么是shtml SHTML语法 SHTML教程 格式 编写 技术
使用SSI (Server Side Include)技术
想要找到既富有创意的平面设计人员,又有脚本开发经验的人员,实在是太难了。而假如一个百分之百的页面都是php脚本的网站,将为页面维护带来非常大的困难。而且使用了php的自动加头和加尾的方法,使得几乎所有页面都是语义不完整的,不能借助任何一款页面设计工具工作,是另一个弊病。
利用SSI技术,可以有效的将HTML网页和CGI脚本逻辑上分开,也可以将重复的HTML元素抽象和独立出来,减轻维护负担。
SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology.
全文:
配置Apache,支持SSI
# This tells Apache that you want to permit files to # At linux or unix can use # You have to tell Apache which files should be parsed.AddType text/html .shtmlAddHandler server-parsed .shtml |
SSI语法
Basic SSI directives Syntax
<!--#element attribute=value attribute=value ... --> |
Today's date
<!--#c onfig timefmt="%Y/%m/%d %a %H:%M:%S" -->Today is <!--#e cho var="DATE_LOCAL" --> |
Modification date of the file
This document last modified <!--#f lastmod file="index.html" --> |
Including the results of a CGI program
<!--#i nclude virtual="/cgi-bin/counter.pl" --><!--#i nclude virtual="/cgi-bin/example.cgi?argument=value" --> |
You can use "#e xec cgi=" directive, but it can be disabled using the IncludesNOEXEC Option.
Including a standard footer
<!--#i nclude virtual="/footer.html" --> |
Executing commands
<!--#e xec cmd="ls" --> |
This feature is dangerous. You can allow SSI, but not the exec feature, with the IncludesNOEXEC argument to the Options directive.
新闻热点
疑难解答
图片精选