added include_species_list.txt creator

This commit is contained in:
mcguirepr89
2022-01-31 11:11:03 -05:00
parent 31c2df3377
commit 70c9f9a14f
3 changed files with 152 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
$file='/home/pi/BirdNET-Pi/include_species_list.txt';
$str=file_get_contents("$file");
$str = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $str);
file_put_contents("$file", "$str");
if (isset($_POST['species']))
foreach ($_POST['species'] as $selectedOption)
file_put_contents("/home/pi/BirdNET-Pi/include_species_list.txt", $selectedOption."\n", FILE_APPEND);
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
?>