Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

CSS & Images breaking on file inclusion

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
It has a reason. when your scripts, (head.php) runs, it will search for css and images inside forums folder, but they aren't available. It would be better if you use absolute urls rather that reltive ones.
[Image: ocN2XB3.png?1]


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by BadGameJul 4, 2016 05:09 AM 1 87 Jul 4, 2016 05:09 AM
Last Post: Squito
[PHP] by -zERAiTMar 29, 2015 03:12 PM 4 274 Mar 29, 2015 03:12 PM
Last Post: notM9
[PHP] by trollsterDec 25, 2012 11:19 PM 8 124 Dec 25, 2012 11:19 PM
Last Post: trollster