I've programmed a web app for my Family, to regulate the Meals in a week, this website is locally hosted on my new Raspberry Pi. To store the Data (The Meals for everyday) a txt.file is used. I've also programmed a Site where Family members can write what they would like to eat. That site works on my Editor (PHPstorm) perfectly but not on the Raspberry Pi. The Problem on the Raspberry is that there are no changes on the txt. file. I really can't figure out why, because on PHP Storm there is no problem.
That is my Code which stores the data in my txt
$datei=file("essen.txt");
$fr=$datei[$t];
$mi=$datei[$t+1];
$ab=$datei[$t+2];
$frneu = $_POST["frueh"]."\n";
$mineu = $_POST["mittag"]."\n";
$abneu = $_POST["abend"]."\n";
array_splice($datei, $t, 1, array($frneu));
array_splice($datei, $t+1, 1, array($mineu));
array_splice($datei, $t+2, 1, array($abneu));
$fp=fopen("essen.txt", "w");
fputs($fp, $datei[0]);
fclose($fp);
$fp=fopen("essen.txt", "a");
for($i=1; $i<count($datei); $i++){
fputs($fp, $datei[$i]);
}
fclose($fp);
I hope someone can help me. Just say I've you need more code