Jump to content

Archived

This topic is now archived and is closed to further replies.

coolme52

Php Important Help Needed - Help Please

Recommended Posts

i am building a script

i 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 panel

can some 1 plz tell me how i can do this

Share this post


Link to post
Share on other sites
Store the settings in a database, or make the admin panel edit the config file.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Ill Explain My Question

For Eg

i have a file name settings.php

in 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 it

but wat i want is an option in admin panel where it says

Enter Your Site Name :

And wat ever u enter there is saved in the config

i hope u got me now

Share this post


Link to post
Share on other sites
http://codewalkers.com/tutorials/57/1.html

Read that. It has all the information you need to start.

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.