doddsey_65 Posted August 3, 2011 Share Posted August 3, 2011 I have a settings.php file which contains an array like so: $settings['board_name'] = 'A Simple Forum'; $settings['board_short_name'] = 'ASF'; But now i have come to the admin part where these settings can be changed i am wondering if this is the best way of handling settings. When the admin chooses to modify one of these settings i would have to open the file, find the line of the setting they want changing and overwrite that line with the new setting. I could store these settings in the database however, which would mean an easier job of replacing settings. Does anyone have any ideas as to which method is best? or if there are any other methods? Quote Link to comment https://forums.phpfreaks.com/topic/243705-saving-settings-to-file/ Share on other sites More sharing options...
trq Posted August 3, 2011 Share Posted August 3, 2011 I would be more inclined to use a database. Quote Link to comment https://forums.phpfreaks.com/topic/243705-saving-settings-to-file/#findComment-1251259 Share on other sites More sharing options...
AbraCadaver Posted August 3, 2011 Share Posted August 3, 2011 For most settings I would use a database as well. Obviously though, the database host, username and password will not be able to be stored in the database. Quote Link to comment https://forums.phpfreaks.com/topic/243705-saving-settings-to-file/#findComment-1251311 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.