emtec Posted December 19, 2008 Share Posted December 19, 2008 i have a file, an config file, wher i want to include several other files. now i want to include this config file on several pages on very different locations. now how can i include the files in the config file so that the file path is correct, regardless from what page the config file is includded. how can i do this? thanks Quote Link to comment https://forums.phpfreaks.com/topic/137743-including-files-from-root-or-fixed-path/ Share on other sites More sharing options...
.josh Posted December 19, 2008 Share Posted December 19, 2008 depends on where file is located. If it's in public_html somewhere, you can at the very least use http://www.yoursite.com/path/to/file.php Quote Link to comment https://forums.phpfreaks.com/topic/137743-including-files-from-root-or-fixed-path/#findComment-719977 Share on other sites More sharing options...
emtec Posted December 19, 2008 Author Share Posted December 19, 2008 already tried that gives me this error Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\wamp\www\cmslabs\versie0.6\inc\configfiles\addadmin.php on line 5 Warning: include(http://127.0.0.1/cmslabs/versie0.6/inc/config.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\wamp\www\cmslabs\versie0.6\inc\configfiles\addadmin.php on line 5 Warning: include() [function.include]: Failed opening 'http://127.0.0.1/cmslabs/versie0.6/inc/config.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\cmslabs\versie0.6\inc\configfiles\addadmin.php on line 5 Quote Link to comment https://forums.phpfreaks.com/topic/137743-including-files-from-root-or-fixed-path/#findComment-719983 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.