diff --git a/encoder/app.php b/encoder/app.php index 562e8c8..7941751 100644 --- a/encoder/app.php +++ b/encoder/app.php @@ -38,7 +38,8 @@ if (isset($_POST['submit'])) { $data_to_save[$field] = $_POST[$field] ?? ''; } - file_put_contents($json_file, json_encode($data_to_save, JSON_PRETTY_PRINT)); + if (empty($errors)) + file_put_contents($json_file, json_encode($data_to_save, JSON_PRETTY_PRINT)); } ?> @@ -138,5 +139,4 @@ function getValue($data, $key) - \ No newline at end of file