I am trying to include a very simple header.html to my index.php but it doesn’t seem to work and i can’t get my finger on the problem:
Here is header.html code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/master.css"/>
</head>
<body>
<header><img src="img/lys.png" class="logo_lys"/></header>
<nav>
<ul>
<li><a href="#">Accueil</a></li>
<li><a href="#">Équipes</a></li>
<li><a href="#">Tournois</a></li>
<li><a href="#">Scrims</a></li>
<li><a href="#">Forum</a></li>
</ul>
</nav>
</body>
<html>
Here is index.php code:
[...content]
<body>
<?php //include("header.html"); ?>
<?php include("header.php"); ?>
<?php //include($_SERVER['C:/Documents and Settings/sabourma/Bureau/site_2']."header.html");?>
[...content]
</body>
</html>
I tried to change header.html to header.php because i read if it’s in html the computer won’t process it.
I also tried to include the full path to my header, but it didn’t work.
Please note that all my files are local right now so it can’t be a server problem.
I also read php may be “disable” but have no idea what this means.
From the comments below your question it seems like there might be two issues:
If you still need php software, you can find it here. After installing everything, there is a folder in it called “htdocs” where you can put your php files. In the browser, you can access this folder via “http://localhost/”. So, e.g., if you have a folder called “greatsite” in htdocs, you can access it in your browser via
http://localhost/greatsite/If you simply haven’t activated php, open up the Xampp starter and enable php and apache.
BTW: You can include html files like php files, both should work, that can’t be the problem.