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 Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/ 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. Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77581 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 Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77583 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. Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77584 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 Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77586 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. Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77589 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 ??? Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77592 Share on other sites More sharing options...
coolme52 Posted August 20, 2006 Author Share Posted August 20, 2006 help me plz Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77752 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. Link to comment https://forums.phpfreaks.com/topic/18107-php-important-help-needed-help-please/#findComment-77783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.