Guteman Posted May 21, 2006 Share Posted May 21, 2006 I am having an issue. I am creating a website with a number of directories. I want to have it so I only have 1 config file in a designated config directory. When im in my admin directory and I want to include my config file, it wont work unless I copy and paste the config.php into the admin directory. I only want 1 config file. What do I need todo to make this work like it should. I cant seem to find any tutorial on this.Thanks,Guteman Quote Link to comment https://forums.phpfreaks.com/topic/10101-one-config-file-please-help/ Share on other sites More sharing options...
ShibSta Posted May 21, 2006 Share Posted May 21, 2006 If your folders were like so:Root-admin--admin.php-config-imagesindex.phpAnd you were in the admin.php, for example you would do:[code]<?phpinclude("../config/config.php");?>[/code]Hope that helps...Each time you go up a directory just use ../ as a prefix...If you had:Root-admin--template---header.tpl-config-imagesindex.phpAnd you wanted to include the config file in your admin header.tpl you'd do this:[code]<?phpinclude("../../config/config.php");?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10101-one-config-file-please-help/#findComment-37588 Share on other sites More sharing options...
Guteman Posted May 21, 2006 Author Share Posted May 21, 2006 Hey I knew there was an easy way todo this, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/10101-one-config-file-please-help/#findComment-37591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.