Having the folder structure down:
ConsideringthatIaminthefileconteúdo.html
andwanttoincludethefilehoras.html
,sincebothareinthesamefolderlevel,soIshoulduse:
include"./horas.html";
To include the dicas.html
file that is in the recursos
folder, I will use:
include "./recursos/dicas.html";
Since the recursos
folder is at the same level as conteúdo.html
Now to include the file catálogo.html
that is in the produtos
folder I should use:
include "../produtos/catálogo.html";
So I will go up one level between the folders and from there enter the path of the desired file.
But knowing that the produtos
folder is a folder that is in the root folder I can use:
include "/produtos/catálogo.html";
Thus
In src='./somePath';
./
means that you are referencing the current folder
In% with% of% with% means that you are referencing a folder that is earlier than the current one. You can use several to search folders on different levels.
Example: src='../somePath';
here I'm looking for the ../
folder in a folder that is 3 levels above the folder where the current script is running.
In src='../../../otherPath';
0 otherPath
means that you are referencing the system root folder