I recently did a little script that does about what you are asking.
If you need it commented, just say so. It consists of three pages.
the first one (variables.php)
<?php
$config["number"] = "0.10002";
$config["2nd_number"] = "0.99";
$config["sth_else"] = "whatever";
// all the variables are part of an array, namely $config.
?>
the second one (editConfig.php)
<?php
require("variables.php");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="doUpdate.php" method="post" name="configVar">
<table>
<?php
foreach ($config as $key => $value) {
print "<tr>\n <td align=\right\">\n ".$key.": \n </td>\n ";
print "<td align=\"left\"><input type=\"Text\" value=\"$value\" name=\"$key\">\n </td>\n</tr>";
}
?>
<tr>
<td colspan="2" align="right">
<input type="submit" name="Submit" value="Update">
</td>
</tr>
</table>
</form>
</body>
</html>
the third one (doUpdate.php)
<?
$oldfile = "variables.php";
$file = fopen($oldfile."new", "w");
flock($file, 2) or die("Kann die Zieldatei nicht locken.");
fputs($file, "<?php\r\n\r\n");
foreach ($_POST as $key => $value) {
if ($key <> "Submit") {
fputs ($file, "$"."config[\"$key\"] = \"$value\";\r\n");
}
}
fputs($file, "\r\n?>");
fclose($file);
unlink($oldfile);
rename($oldfile."new", $oldfile);
header("Location: editConfig.php");
?>
Let me know whether it helped or didnt 😉