diff --git a/index.php b/index.php index b23b9fd..133bff2 100644 --- a/index.php +++ b/index.php @@ -14,6 +14,15 @@ function get_color_from_ip($ip) { //header("refresh: 28"); header("Cache-Control: no-cache, no-store, must-revalidate"); +if (!is_dir("data")) { + // initialize everything + mkdir("data", 0755); + file_put_contents("data/sentences.txt", "\n"); + file_put_contents("data/archive-links.txt", "\n"); + file_put_contents("data/config.json", "{\n\n}\n"); + print("
Data directory automatically initialized
"); +} + if (array_key_exists("submitted", $_REQUEST)) { $word = urldecode($_REQUEST["submitted"]); //print("Jemand schreibt ".$word."