PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi everyone. I'm having problems displaying the file called "nav.php", using include, in my "index.php". The contents of nav.php displays but it can't display the images which are referenced inside nav.php with a variable declared in my config.php. Please see the codes below to understand the structure of the file.
why do you use http://www.... here?
It starts a new php instance on the server domain.com that is not related to the "current" php instance, they do not share variables.
Common
>nav.php
Folder1
>index1.php
Folder2
>index2.php
Folder3
>Folder4
>index3.php
Case this is my file structure how can I reference my "common" folder so that everytime I want to include "nav.php" I just have to add the reference to common instead of using "../" for index 1 n 2 and "../../" for index4.