Hello, for example i have a settings.php file, the contents is
<?
$params["debug"] = true;
$params["title"] = "test";
$params["timeout"] = 1000;
?>
and a html form used to change the settings:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Server Settings</title>
</head>
<body>
<div class="flo2">
<div class="lc"><div class="commonbox"><div id="settings" class="commonbox sn_greenbor">
<div class="login">Server Settings</div>
<div class="boxcontent"><form name="server_settings" method="post" action="set.php">
<table cellpadding="3" cellspacing="0" border="0">
<tr><td colspan="2"></td></tr>
<tr>
<td style="text-align:right !important;"><strong>Title:</strong></td>
<td><input type="text" name="title" maxlength="100" size="22" alt="title" tabindex="1" style="width: 200px !important;" value=""></td>
</tr>
<tr>
<td style="text-align:right !important;"><strong>Timeout:</strong></td>
<td><input type="text" name="timeout" maxlength="10" size="22" alt="timeout" tabindex="2" style="width: 200px !important;"></td>
</tr>
<tr>
<td><strong>Debug Mode:</strong></td>
<td>
<input type="checkbox" name="debug" id="debug">
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
<td valign="bottom"><div class="SetButton clearFix">
<div class="floatL"><input type="submit" name="btnSet" value="Change Settings" tabindex="3"></div>
</div></td>
</tr>
</table>
</body>
</html>
How to connect the form to php, what is the contents of the set.php? (php file to be executed after I press Change Settings)
something like search the word true in $params["debug"] = true; and replace it to false according to the html form (if the checkbox is checked or not)
and how to read the existing value in the settings.php and display it in the form.
something like if the settings.php have a $params["debug"] = true, so the checkbox in the form is checked
thanks and sorry for my bad english
I hope you're not confused..