制作没有框架的网站

Kar*_*rem 1 html php frames

我想在没有框架的情况下制作我的主页,如果我只是将我的设计拆分为index.php,那么它是header.php/footer.php,然后将它们包含在每个页面上?

You*_*nse 5

是的,您可以将index.php拆分为header.php/footer.php,然后将它们包含在每个页面上.请注意,您的页面可以不是静态HTML而是PHP脚本,以显示带有一个脚本的多个页面.
我建议也不要像普通的结构那样

include 'header.php';
//do some stuff
include 'footer.php';
Run Code Online (Sandbox Code Playgroud)

但另一种结构,更有用:

//do some stuff, retrieve all data.
include 'header.php';
include 'page.php'; //include page template
include 'footer.php';
Run Code Online (Sandbox Code Playgroud)