title: php Include and path to other files
body: <p>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.</p>
  
  <p>As the page where the include is called changes, so does the location of the files, that the include calls. Get it?</p>
  
  <p>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"</p>
  
  <p>index.php code:<code>&lt;?php include("load.php"); ?&gt;</code></p>
  
  <p>index2.php code: <code>&lt;?php include("../load.php"); ?&gt;</code> </p>
  
  <p>load.php code: <code>&lt;?php echo '&lt;img src="image.png"/&gt;'; ?&gt;</code></p>
  
  <p>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. </p>
  
  <p>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.</p>