Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


how to use a php includes across multiple directories sub directories with relat using -'php,html,include'


how to use a php includes across multiple directories sub directories with relat  using -'php,html,include'

I'm having difficulty with paths in a cms system I'm attempting to build, I've basically got a folder with my header.php and footer.php files inside.

These are included in index.php and work fine. But then when I attempt to use the same includes in a file within my admin sub directory, the images and CSS are broken, obviously because the relative path is now wrong.

So my question is, how can I overcome this?

After reading some of the other questions on here and various other sources, I think absolute paths are the way forward, but I've always used relative paths, so the various concepts of using config files to specify an absolute path are confusing me.

I usually manage to work things out for myself, but it's been a long day and Im stumped!
    

asked Sep 7, 2015 by rajesh
0 votes
5 views



Related Hot Questions



Government Jobs Opening


...