Here is the sample code to give you an idea:
settings.php
[code]<?php
// reading settings from the text file
$setting1 = ‘’;
$setting2 = ‘’;
if(is_file(‘settings.txt’)){
$lines = file(‘settings.txt’);
$setting1 = $lines[0];
$setting2 = $lines[1];
}
?>
Setting 1:
Setting 2:
[/code]
save.php
[php]<?php
// save settings to a text file
$fp = fopen(‘settings.txt’,‘w’);
if($fp){
fputs($fp,$_POST[“setting1”]."\n");
fputs($fp,$_POST[“setting2”]."\n");
}
fclose($fp);
?>[/php]
You may want to add validation of user input (i.e. strip special chars, new lines etc.)
And if you are using PHP 5, you can use file_put_contents() function to write data to a file.