php include to files outside GS doesn't work inside theme - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Themes (http://get-simple.info/forums/forumdisplay.php?fid=10) +--- Thread: php include to files outside GS doesn't work inside theme (/showthread.php?tid=3152) |
php include to files outside GS doesn't work inside theme - charles_i - 2012-05-09 I'm using GS for only certain areas of my site. I want to include my nav bar and my footer from the site's root inside a theme page but I can't get it to work. So my site is at (say) mysite.org and my GS pages are in mysite.org/getsimple/theme/mytheme. Now when I create my theme page I want to link the nav and footer to my main site files which are here: mysite.org/footer.php mysite.org/nav.php but this won't work. This is correct - but it doesn't work: <?PHP include ('../../../footer.php'); ?> All of these return the correct path: $myfooter = "mysite.org/footer.php"; $myfooter = "http://".$_SERVER['HTTP_HOST'].'/footer.php'; $myfooter = "http://'.parse_url($url, PHP_URL_HOST) . '/footer.php'"; but none of them work inside the include. Any ideas? Thanks Charles php include to files outside GS doesn't work inside theme - yojoe - 2012-05-09 1. Did you try to move files to theme directory ? 2. Are you sure your hosting provider has php include/require/fopen functions enabled ? php include to files outside GS doesn't work inside theme - charles_i - 2012-05-10 The files work inside the theme directory - with an include - and fopen is enabled on the site. It's a work around which is OK but it means if I change the nav or the footer I'll have to change it in two places which sort of defeats the purpose of an include. Strange that I can't get the root of the site to be recognised outside of GS. php include to files outside GS doesn't work inside theme - Carlos - 2012-05-10 charles_i Wrote:This is correct - but it doesn't work: Try with: Code: <?php include '../footer.php'; ?> php include to files outside GS doesn't work inside theme - charles_i - 2012-05-16 I was sure that I had tried that (and every level) but I guess not because it works! Thanks! |