这取决于目的。
数据库查询相关的帖子,决定了其中的内容,我在没有任何输入之前调用它。此外,在进行任何输出之前,应该显示包含原始标头信息的任何类型的PHP命令。
任何与内容相关的内容都可以放置在页面上的任何位置。PHP代码真的无处不在-无论在哪里,无论您想从PHP动态创建HTML的方式。
我的页面通常采用这样的结构:
代码语言:javascript复制
include 'start.php';
$pagetitle = 'the services we offer (branding, web, print etc.)';
$metatitle = 'Our Creative Services (branding/logo, web, print)';
$scriptinclude = 'whatwedo.js';
include 'header.php'; // contains the
and a few more elements to start the header/menubar etc.?>
// content here, mixed with PHP if you like...
include 'footer.php'; // contains the footer HTML, as well as etc. to wrap things up.
?>