From 67a81f006e055d82d4be8aaea96d69524b4fca74 Mon Sep 17 00:00:00 2001 From: Andrea Fiorencis Date: Fri, 23 Jan 2026 11:24:52 +0100 Subject: [PATCH] Fix csv file not creating if data folder doesn't exist --- add.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/add.php b/add.php index c74f682..7fe4345 100644 --- a/add.php +++ b/add.php @@ -7,6 +7,9 @@ $voto = $_POST['voto']; $item = [$nome,$classe,$dataValutazione,$tipo,$voto]; +if(!is_dir("data")){ + mkdir("data"); +} if(file_exists("data/voti.csv") == false){ $file = fopen("data/voti.csv", "w"); fwrite($file, "Nome alunno,Classe,Data valutazione,Tipo valutazione,Voto\n");