Jump to content

CSS & Images breaking on file inclusion


trollster
 Share

Recommended Posts

Hello all,I've built this site and layout using bootstrap. http://ankursinha.net/test/ . I've broke the index file into head.php (contains the whole html head like scripts, meta, link rel, etc), then header.php (contains the logo, search bar, etc), then navbar.php (contains the navbar), and the footer. I've placed an index file along with it and I used: include 'head.php', etc and got it working. But when I created a folder forums, added the same code, but used include '../head.php', etc all the content came, but the css and the image logo didn't appear. I saw the page source for both the links are the same. Here is the link. http://ankursinha.net/test/forums/The codes for both are the same, just that I added two dots to traverse back to the parent directory and include files under the forums folder, the source shows everything is included but the css and images do not appear. Please help.Thank you

Link to comment
Share on other sites

I get a 404 upon clicking the provided link. On the surface though, If you look in the error console though, you should see errors indicating what the broken links are, and that should at least give you an idea of where the browser is looking for these assets, compare against the actual location of the assets, and then use that combined information to adjust the path accordingly in the include file.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...