我需要帮助。在我的网站上,我使用URL参数来决定在页面上包含哪些其他PHP文件。我的第一个问题是:index.php中应该包含什么以及包含的PHP文件应包含哪些内容?PHP index.php包括结构
在互联网上,我发现说明,说明该结构的index.php:
<html>
<head>
<?php include 'header.php'; ?>
</head>
<body>
<?php include 'menu.php'; ?>
<?php include 'content.php'; /* Including page based on the parameters in the url */ ?>
</body>
</html>
通过这样的结构,我怎么可以改变数据在<head>
部分基于在content.php
的内容?例如,对于index.php?option=article&id_article=1
,我将包含article.php
并显示带有ID为1的文章。那么,在包含文章之前编写<head>
时,如何更改<title>
,<meta
>等内容?
谢谢!
“在网上我发现说明......” - 我建议你尝试不同的互联网说明。 – Smandoli
你能用javascript吗? – Sharlike
你的问题可能太宽泛,无法在这里回答。也许你应该看看像CakePHP,Kohana,Laravel这样的框架 – chrislondon