When using php include function, I can easily use the same code on multiple pages, now the problem I ran into was, that my include file, outputs and image.
As the page where the include is called changes, so does the location of the files, that the include calls. Get it?
Example: I got a called "index.php". I also got a file called "load.php". and I got a file at last called "/folder/index2.php"
index.php code:<?php include("load.php"); ?>
index2.php code: <?php include("../load.php"); ?>
load.php code: <?php echo '<img src="image.png"/>'; ?>
When loading index.php, the image is shown perfectly as it ought to. When loading index2.php, which is located in another folder, but loads the "load.php" file successfully, the image is saying it cannot be found, which makes sense, since index2.php is calling the image, as if it was in the same folder, which it isn't.
So, is there any way to do this? I'm trying to avoid using a full url, but if it's the only way I'll use that. I'm just looking for a better option.