把php代码放在哪里?

把php代码放在哪里?

这取决于目的。

数据库查询相关的帖子,决定了其中的内容,我在没有任何输入之前调用它。此外,在进行任何输出之前,应该显示包含原始标头信息的任何类型的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.

?>

相关推荐

模特是什么意思
365直播网APP下载

模特是什么意思

07-16 👁️ 3257
荣耀怎么设置呼叫转移
365bet亚洲官网

荣耀怎么设置呼叫转移

11-02 👁️ 6497
Java中的一个类怎么调用另一个类中的成员
365娱乐平台网址

Java中的一个类怎么调用另一个类中的成员

08-20 👁️ 6185