Hello.
Help me please.
Here I have the code:

$date = date("DM d H:i:s T y", time()); $handler = fopen("путь к файлу .properties", "w"); fwrite($handler, "#Minecraft server properties\n#{$date}\n"); foreach($saveConfig AS $name => $value) { fwrite($handler, $name . "=" . $value . "\n"); } fclose($handler); 

In this case, the $ saveConfig parameter has data from the fields.

  $saveConfig = $_POST['config']; $saveConfig['gamemode'] = intval($saveConfig['gamemode']); 

This field gives a parameter to $ saveConfig.

 <input type="text" class="form-control" name="config[gamemode]" value="1"> 

But for some reason, when saving, writing to the file does not occur ... What is the problem?

  • At first glance, the problem is not in the code, most likely problems with access to the file - with a path or with permissions - splash58
  • Well, the rights to write to me are 777 ... Yes, and the path to the file is correct. - Influence
  • Is the file being created? - splash58
  • Yes. I have it also used to read data. I have a function to read .properties files but for some reason I cannot save ... - Influence
  • check $ handler for false, and fwrite result for non-zero - splash58

0