I have the following structure:
| - / root
| - / services
| --- / registrations
| - / view
| --- dashboard.php
| --- menu.php
| --- / registrations
| ---- / people
| ----- Include_Personal.php
| - / scripts
| - menu.js
Inside the dashboard.php I have the following javascript: $ ("body"). load ("menu.php") which is used to populate a navbar with the options. - Within menu.php I have the file import menu.js
The problem happens when I try to populate the same menu inside "Include_Personal.php" because it is taking the path relative to that file (root / files / people). Even though I use the "../../menu.php" path in the load it tries to look for the menu.js in the directory referring to root / cadastros / personas /.
Would there be a way for me to import these files in an obscure way, without having to leave all the files in the same directory?