0

Hi,

I cant get my around this..

I want to store some config details in config.php like so..

$conf['audio'] = "play";
$conf['email'] = "send";
..
..
..

how can i use a form to edit the variables by writing to the file.

The form will have the option to change any or the variables so one might get changed and the other may not. Or multiple oprtions might get changed at same time.

i have had a play with file WRITE and APPEND but keep losing stuff and getting strange results. i would post but i deleted the failed attempts.

Any help would be great
thanks
Vince

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by diafol
0

perhpas storing the data in a DB would be better.
else you could store data in a text file, but that's really awkward.

config TABLE

[B]config_id  config_key  config_value[/B]
1          email       send
2          audio       play

Edited by diafol: n/a

0

sorted it, was easier than it seemed lol.

include the config in the page with form. set the default value of form fields as per the file included.
on form submit write every field to file
$stringData = "define(\"AUDIO\",\"FALSE\");\n";

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.