I need help. On my site I use URL parameters to decide which other PHP files to include on the page. My first question is: What should be in index.php and what should be in the included PHP file?
On the Internet I found instructions, suggesting this structure for 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>
With this structure, how can I change the data in the <head>
section based on the content in content.php
? For example, for index.php?option=article&id_article=1
, I will include article.php
and show the article with id 1. How, then, can I change the <title>
, <meta
>, etc content when <head>
was written before including the article?
Thanks!