PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Header

Milad The Computer Guy
Milad The Computer Guy
20,287 Points

After creating inc/header.php, index.php and suggest .php don't load the background images of navigation and logo

I am running the code locally on my computer using WAMP server, After creating inc/header.php and include them on my index.php and suggest.php, I don't get the same result. the background images (for logo and each navigation item) the must be loaded from style.css don't load on my page. interesting thing is after I go to Chrome Dev tool, and inspect the elements , after I checked and unchecked the background-image for .branding-title cass in css section of dev tool then I am able to see them. any help? it's really bugging me.

Hi Milad,

Did it all work properly before you broke up the page?

You're correct. The logo and nav icons are css background images.

Can you post header.php and index.php?

So you don't see either the logo or the nav icons but when you uncheck/check the background property, you see both the logo and nav icons?

3 Answers

Milad The Computer Guy
Milad The Computer Guy
20,287 Points

Yes Exactly , and more weird is instead of the background image provided, I uploaded an image from myself, and it worked, then I switched it back to the original image provided by treehouse and now it works fine, OI don't have any problem anymore. it loads the images fine. I love to know what the problem was. it something beyond the explanation probably

That's really strange. Unfortunately, I don't know why that happened, but I'm glad you got it working. I've never experienced that myself.

I had the same problem.

If it helps anyone, I changed the permissions of all the images to readable by everyone and they then displayed fine.

Hi i solved the problem by changing the code that was instructed, slightly. instead of <?php include("inc/header.php"); ?> in the index.php file i just changed it to <?php include("header.php"); ?> it worked fine after that. not sure why though if anyone could explain that would be awesome.

Thanks.