hi
I have written a news script that has all the setting variables stored in a settings file.
Now I have written a form to make it easier for the webmaster to change the settings.
_settings.php__________
<head><title>SadisticNews Settings</title></head>
<body>
<?php require("settings.ini"); ?>
<form action="settings2.php" method=post>
....all the settings form stuff here....
<input type="submit" value="Submit"><input type="reset">
</form>
</body>
I use the require() command at the start to read all of the current values from the settings file. then in the forum I use the variables from settings.ini as value=$variable so that the fields start as the current ones (and for drop downs, radios and check boxes I have short if statements to see whether to set it as selected/checked or not). For the name attributes of the form items I used the same name as the variable in settings.ini (I think this might be my mistake) so that I wouldn't have to worry about more than one variable name for virtually the same thing. for example the variable in settings.ini for the width of a table is $width = "50%"; and the form item to change this is <input type=text name="width" size=3 value=<?php print("\"$width\""); ?>>. This displays the current width variable to start with as I wanted.
_settings2.php__________
<head><title>SadisticNews Settings</title></head>
<body>
<?php
print("$width");
?>
Changes have been made.<br>
Load (or refresh) your main news page to see them.
</body>
does not print the width variable from the form in settings.php as it should. it only displays the html text after the ?> tag.
so I am wondering what I am doing wrong. (I did have settings2.php actually writing to a file which worked except for when I went to write one of the form variables. which is why I am just trying to print the variable as a test).
thanks for actually reading all of this
-Paddy