This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
filespread/res/php/savelist.php
Marcel Kapfer 56e607c04a Implemented new saveAddresses method in Dart
Fixes the bug, that long list can't be sent via get methods.
2017-06-16 00:04:50 +02:00

21 lines
368 B
PHP

<?php
# COPYRIGHT (c) 2016-2017 Marcel Kapfer (mmk2410)
# MIT License
$content = json_decode($_POST["data"], true);
$filename = "../../lists/" . $content["list"];
$file = "";
foreach ($content["addresses"] as $address) {
$file = $file . $address . "\n";
}
$handle = fopen($filename, "w");
if (fwrite($handle, $file)) {
echo "0";
} else {
echo "1";
}