I currently learning HTML, JS and PHP all at the same time (cus why not?)
And implementing the header.html in PHP is not so fun.
It works on the main page or "index.php" by just adding:
<?php include("header.html");?>ex.php
And then the other pages by adding:
<?php include("../header.html");?>ex.php
But after a while you forget how many "../../../" you need to put in, in order to get to root of the server folder. Is there a way to get to root of webserver easily? simply "/header.html" is not working out.
any ideas?
Solution?:
My current solution is simple to set the header path as
/home/yuannan/Web/header.html
Or where your file is from the ROOT OF THE SERVER and not the web server