I'm creating a PHP website that has one index.php file and instead of having files something.php, about.php, contact.php I have set it up as the following: index.php?p=something, index.php?p=contact etc.
Currently my index.php code looks like this:
<head>
<title>Something</title>
<link href="theme.css" rel ="stylesheet" media="screen">
</head>
<body>
<?php
if (@$_GET['p'] == 'something') include 'pages/something.php';
elseif (@$_GET['p'] == 'about') include 'pages/about.php';
</body>
Now the problem is that I want to have different metadata in index.php, something.php and about.php. I know I have to add metadata between <head></head>
, but something.php and about.php are included later. How can I have different metadatas for the files? Is it possible to (re)set metadata after <head></head>
tags?