避免重复标题&页脚 [英] Avoid repeating headers & footers
问题描述
我建立的网站至少有7页,我正在寻找一种方法,以避免重复所有标题&页脚等。
我知道有框架和iframe,但有些浏览器不支持这些,我想做一些更有效和灵活的更新。任何想法/建议?
感谢您的信息!我一定会试试看。
还有一件事是,我有一个登录表单在我的标题。这些方法会影响它吗?
回答
侧面包括的方式,只是一些澄清:
1)如果你选择使用PHP,你可以按照Sotiris描述的 - 这是非常常见的选择,并且btw.virtually所有主机都支持php。
2)虽然文件将有扩展名.php,你可以把你的纯html代码。
3)要在您的计算机上进行测试并在上传之前进行测试,您必须在其上安装服务器。在这一点上,我认为这是最简单和最快的,你去去一些现成的解决方案 - 这些是免费下载的:
http://www.wampserver.com/en/ (适用于Windows)
http://www.mamp.info/en/index.html (适用于Mac)
http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/ (Linux版)
I am building a website with at least 7 pages and am looking for a way to avoid having to repeat all headers & footers etc. on every single html document.
I know there are frames and iframes but some browsers don't support these and I want to do something more efficient and flexible for updates. Any ideas/suggestions?
Thanks for the information guys! I'll be sure to try them out. One more thing is that I have a login form within my header. Will these methods affect it?
Regards
Yes, server side includes are the way to go, just a few clarifications:
1) You can do it as described by Sotiris if you choose to use PHP - which is very common choice, and btw.virtually all hosts support php.
2) Although the file will have extension .php, you can put your pure html code in it.
3) To be able to test and see this on your computer before uploading it, you have to install server on it. At this point I think it's simplest and fastest for you to go for some ready made solution - these are downloadable free:
http://www.wampserver.com/en/ (for Windows)
http://www.mamp.info/en/index.html (for Mac)
http://tuxtweaks.com/2010/04/installing-lamp-on-ubuntu-10-04-lucid-lynx/ (for Linux)
这篇关于避免重复标题&页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!