coolme52 Posted August 20, 2006 Share Posted August 20, 2006 i am building a scripti wanna give a feature so that the user can select the feature direct from admin panel so noo need to open the config file and edit it as it can directly be done from admin panelcan some 1 plz tell me how i can do this Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 20, 2006 Share Posted August 20, 2006 Store the settings in a database, or make the admin panel edit the config file. Quote Link to comment Share on other sites More sharing options...
coolme52 Posted August 20, 2006 Author Share Posted August 20, 2006 in a config file for eg config.phpcan u post a code example to do it Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 20, 2006 Share Posted August 20, 2006 If I read your post correctly, what you are asking for can be already done from the admin panel (you wrote?) so why not use the same code to let the user change it - although the concept of any user messing with a configuration variable sounds dangerous.If I've misinterpreted your post, explain the problem in more detail.Edit:[quote]can u post a code example to do it[/quote]No, that wouldn't be a helpful exercise since [b]you[/b] have all the relevant information anyone would use to 'post a code example'. The online manual has many examples of how to read a file and write to a file. Why don't you try, and if you're unsuccessful then post your code here for help. Quote Link to comment Share on other sites More sharing options...
coolme52 Posted August 20, 2006 Author Share Posted August 20, 2006 Ill Explain My Question For Egi have a file name settings.phpin that i put a code$sitename = "My Site Name"now if the script user wants to change the site name he has to open config.php and edit itbut wat i want is an option in admin panel where it saysEnter Your Site Name : And wat ever u enter there is saved in the configi hope u got me now Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 20, 2006 Share Posted August 20, 2006 http://codewalkers.com/tutorials/57/1.htmlRead that. It has all the information you need to start. Quote Link to comment Share on other sites More sharing options...
coolme52 Posted August 20, 2006 Author Share Posted August 20, 2006 do u mean i should rewrite the settings.php everytime settings are changed ??? Quote Link to comment Share on other sites More sharing options...
coolme52 Posted August 20, 2006 Author Share Posted August 20, 2006 help me plz Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 20, 2006 Share Posted August 20, 2006 [quote author=coolme52 link=topic=104955.msg418918#msg418918 date=1156088384]do u mean i should rewrite the settings.php everytime settings are changed ???[/quote]How else would the right values be read?In the manual, look at the file open, file read, file write commands. Quote Link to comment 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.