Hi guys, new here and hope this section will be ok to post my problem as I am not entirely sure what it falls under. I am re-designing my website and changing it to php. Everything has gone well, the only thing I have used php for is uncluded and forms to email.
Now it's a hard problem to explain but will try my best. It seems as though I have got confused along the way with my file structure. Working on a test server (from my own computer) it works fine but when I uploaded my files to my host I ran into problems.
The files in my root directory display the webpages correctly but any files in a sub folder such as /portfolio do not display correctly. What happens is the images in the sub folder do not work (images for the main site, i.e the layout).
I have a folder called includes, my root looks like this:
[
i104.photobucket.com ]
In the includes folder I have three files, header.php right-section.php and footer.php
For this example let's focus on
header.php In header.php I have the top part of my design, including images for the layout. The filepath for the images is like this:
/images/example-image.jpg Now the root files understand this and when the include is called it displays all the images correctly however if a page from a sub folder, for example a page at this level:
/portfolio/client-name.php This page will load and have the includes working but any images in the header.php will not load. I have tested this and if I add this:
../images/example-image.jpg to the code in my header.php file then it makes the images show for the sub folders but then the images do not show for any webpages in my root folder...does this make sense?
I am hoping there is an easy solution that I can understand, I am not good with php and there must be a way to do it as my site is not even that big compared to some of the websites on the internet. There must be a way to keep organised without duplicate files.
Apologies for how long this message is and appreciate any help.
Thanks
Kev