As I have learned so far, using the ./
reference to the current folder, while the ../
references one level up the current folder, and using /
references the root directory.
So when adding the relative path inside an image source's attribute in all three conditions it works fine, but when trying to use the three ways with Include
, Both ./
and /
references the current folder.
Is there any misunderstanding? because I am confused. the code I use :
<?php
echo '<strong>This is the child using ./ </strong><br><br><img src="./image.jpg"><br><br>';
echo '<strong>This is the parent using ../ </strong><br><br><img src="../image.png"><br><br>';
echo '<strong>This is the root using / <br><br><img src="/image.png"></strong><br>';
include('./file.php');
include('../file.php');
include('/file.php');
?>
'; echo 'This is the parent using ../
'; echo 'This is the root using /
'; include('./file.php'); include('../file.php'); include('/file.php'); ?>` – Mohamed Omar Nov 03 '16 at 22:20