Archimedees Posted January 29, 2008 Share Posted January 29, 2008 I want to create a php file that I will include in all my files to enable my scripts find specs.conf file which they require in order to execute. I was thinking of something like <?php // define specs.conf name and path define("specsname", "Specs.conf"); define("specspath", "home/ragley/config/space.conf"); <? Now, let's suppose this was working, I would then include it in all of my scripts that need to use specs.conf Please assist me find out why it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/88350-a-php-file-with-file-name-and-path-to-be-used-in-other-scripts/ Share on other sites More sharing options...
Archimedees Posted January 29, 2008 Author Share Posted January 29, 2008 Pleeeeease???? I want to create a php file that I will include in all my files to enable my scripts find specs.conf file which they require in order to execute. I was thinking of something like <?php // define specs.conf name and path define("specsname", "Specs.conf"); define("specspath", "home/ragley/config/space.conf"); ?> Now, let's suppose this was working, I would then include it in all of my scripts that need to use specs.conf Please assist me find out why it doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/88350-a-php-file-with-file-name-and-path-to-be-used-in-other-scripts/#findComment-452143 Share on other sites More sharing options...
themistral Posted January 29, 2008 Share Posted January 29, 2008 It's not clear what you are asking for. Are you saying that what you want to know is how to include this file? <?php include('dir/path/filename.php'); ?> Add this to all scripts you want to include the file in. Quote Link to comment https://forums.phpfreaks.com/topic/88350-a-php-file-with-file-name-and-path-to-be-used-in-other-scripts/#findComment-452149 Share on other sites More sharing options...
Archimedees Posted January 29, 2008 Author Share Posted January 29, 2008 Can some body please show me the correct way of defining a constant for a file name using define (); Please? Quote Link to comment https://forums.phpfreaks.com/topic/88350-a-php-file-with-file-name-and-path-to-be-used-in-other-scripts/#findComment-452290 Share on other sites More sharing options...
scottybwoy Posted January 29, 2008 Share Posted January 29, 2008 there is little wrong with your define statement. Usually it is best practive to use uppercase for your constants, but that is neither here nor there. Try turning on errors in your php.ini file or use ini_set() <- look in the manual. And see where the error may lie. It is probably down to spelling or you directory path. Are you meant to use "specsname" instead of "space.conf" it seems there is no need to use that constant! as themistral says, it is unclear what u are asking and i know it can be frustrating, but many people will ignore your pleas if you don't ask nicely. good luck Quote Link to comment https://forums.phpfreaks.com/topic/88350-a-php-file-with-file-name-and-path-to-be-used-in-other-scripts/#findComment-452306 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.