From 30666125f21e99fe15f87be7119f5a84204cda3b Mon Sep 17 00:00:00 2001 From: Thomas de Roo <2+thomas@noreply.localhost> Date: Mon, 15 Jun 2026 09:49:56 +0200 Subject: [PATCH] Add import_csv.php --- import_csv.php | 162 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 import_csv.php diff --git a/import_csv.php b/import_csv.php new file mode 100644 index 0000000..2950b47 --- /dev/null +++ b/import_csv.php @@ -0,0 +1,162 @@ + $id++, + + 'question' => + trim($row[0]), + + 'answer' => + trim($row[1]), + + 'correct' => 0, + 'wrong' => 0 + ]; + } + + fclose($handle); + + JsonDB::write( + + listPath( + $_SESSION['user'], + $lang, + $list + ), + + [ + + 'metadata' => [ + + 'title' => $list, + + 'language' => + $lang, + + 'created' => + date('c'), + + 'wordCount' => + count($words) + ], + + 'words' => $words + ] + ); + + header( + 'Location: language.php?lang=' . + urlencode($lang) + ); + + exit; + } +} +?> + + + +
++Taal: += htmlspecialchars($lang) ?> +
+ ++Lijst: += htmlspecialchars($list) ?> +
+ + + ++CSV formaat: +
+ ++question,answer +dog,hond +cat,kat +horse,paard ++ +