Assuming I have a file named home.php
and it is has the following codes:
<html>
<head>
<p>Head do home.php</p>
</head>
<body>
<span>Body do home.php</span>
</body>
</html>
Then I also have the file menu.php
:
<html>
<head>
<p>Head do menu.php</p>
</head>
<body>
<div>
<span>Body do menu.php</span>
</div>
</body>
</html>
I also have, for example, a file to include the files by header
, ìncludes.php
for example:
<html>
<head>
<script type="text/javascript"></script>
<script type="text/javascript"></script>
<link rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="">
</head>
<body>
</body>
</html>
And then the structure of the files ( home.php
, contato.php
, pedidos.php
and so on ...) would look like this:
<?php
include_once 'includes.php';
include_once 'menu.php';
?>
<html>
<head>
<p>Head do home.php/contato.php e por ai vai...</p>
</head>
<body>
<span>Body do home.php/contato.php e por ai vai...</span>
</body>
</html>
Everything works correctly, however, if we are to inspect the source code of the page, we see the following way (with several repetitions of the tags <html>
and <body>
, this can give problem or the browsers correct?):
<html>
<head>
<script type="text/javascript"></script>
<script type="text/javascript"></script>
<link rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css">
</head>
<body>
</body>
</html><html>
<head>
<p>Head do menu.php</p>
</head>
<body>
<div>
<span>Body do menu.php</span>
</div>
</body>
</html><html>
<head>
<p>Head do home.php/contato.php e por ai vai...</p>
</head>
<body>
<span>Body do home.php/contato.php e por ai vai...</span>
</body>
</html>