I use require_once("header.php");
for all pages of my website. Though, I feel like I can only use that code for files filed directly under the public_html folder. If I use the require_once("header.php");
code for any other files located in a directory (e.g. shirts) under public_html, such that you have public_html/shirts/example.php, the header.php doesn't load the images, links, or any other pages correctly.
I know to resolve this in the short term, I can make a new header just for that directory and add ../ to all the code, but I think there's an easier way. Does anyone know of a way I can just change the code of header.php, so I don't have to make separate headers?
Thanks.