Guest FirefoxRocks Posted July 27, 2009 Share Posted July 27, 2009 Is it a good idea to have a config.php file for anything important for the application to run? What I mean is that like when you install phpBB3, Joomla! or applications like that, during installation it asks that you make your config.php file writable so that it can write variables to it.Right now I'm storing all my variables in the database except for the database server, database name, user and password. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 27, 2009 Share Posted July 27, 2009 Yes, it's a good idea to do that. Link to comment Share on other sites More sharing options...
gekk0 Posted July 28, 2009 Share Posted July 28, 2009 i tend to use define() on files like a config or functions file (or anyfile that is never called up directly but included in a main script).so for example in the main file e.g. index.php <?php//Define constantdefine("CONSTANTNAME", "true");//Then include the config fileinclude('config.php');?> and in the file to be included eg config.php <?php//Check if file is defineddefined('CONSTANTNAME') or die('HACKING ATTEMPT');?> seen this used in various major php scripts for a bit of security Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted July 28, 2009 Share Posted July 28, 2009 That is discussed here: http://w3schools.invisionzone.com/index.php?showtopic=26378 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.