Location: PHPKode > projects > phpSC > modules/edit_ini.php
<?PHP
if(isset($_POST['textarea'])) {
$filename = _DNAS_CONFIG;
$content = $_POST['textarea'];
$file = fopen($filename,'w');
if(fwrite($file,$content)) {
$port = conf_port($filename);
$ip = conf_ip($filename);
$sql = "UPDATE servers SET ip = '$ip', port = '$port' WHERE servers.id = '".$_SESSION['server_id']."'";
mysql_query($sql,$conn) or die (mysql_error());
echo "<center>Successfully updated <strong>$filename</strong>.</center>";
}
else
{
echo "<center>Couldn't write to <strong>$filname</strong>.</center>";
}

fclose($file);
}
?>
<?PHP
$ini = file_get_contents(_DNAS_CONFIG);
?>

<center>
  <p></p>
  <p>Editing: <strong>
    <?= _DNAS_CONFIG ?>
    </strong><br />
  </p>
  <form method="post" action="index.php?module=edit_ini">
    <p>DO NOT ADD OR REMOVE LINES. IF YOU DON'T WANT<br>
      A SETTING, COMMENT IT OUT WITH A ; . </p>
    <p>
      <textarea name="textarea" cols="60" rows="25"><?= $ini ?>
  </textarea>
    </p>
    <p>
      <label> <strong>
      <input type="submit" name="Submit" value="CHANGE .CONF FILE PERMANENTLY">
      </strong> </label>
    </p>
  </form>
</center>
Return current item: phpSC