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; + } +} +?> + + + + +CSV upload + + + + +
+ +
+ +

CSV upload

+ +

+Taal: + +

+ +

+Lijst: + +

+ +
+ + + + + +
+ +

+CSV formaat: +

+ +
+question,answer
+dog,hond
+cat,kat
+horse,paard
+
+ +
+ +
+ + + \ No newline at end of file