PHP Directory Base - Need Help Please

Hey, so I’ve encountered a problem with my php/html/css website.
I’ve created a secondary folder. My files in that secondary folder includes the footer.php and the header.php from the root directory, but unfortunately the images those 2 files calls don’t appear in the page of my secondary folder, since the directory of those images in is my image folder in my root directory.

How can I fix this?

The code inside inside my header.php is:

<img src="images/logo.png" alt="Logo" />

How can I change the src to “…/images/logo.png” when my header displays in another folder?

Thanks.

You can use absolute path - this will work for any pages on your site regardless of folder where your page is located:

<img src="/images/logo.png" alt="Logo" />
Sponsor our Newsletter | Privacy Policy | Terms of Service