$_SESSION["ts_user"],"cont"=>$_POST["cont"],"time"=>time()); array_push($jsonD["posts"], $newPost); $newj = json_encode($jsonD); file_put_contents("data/topic/".$_POST["topic"].".json", $newj); $id = count($jsonD["posts"]) - 1; echo "Your post has been submittedhere."; } }else{ echo "forums.error.unknown"; } } else { echo "Something went wrong.
"; echo "Debug info: ".var_dump($_SERVER["REQUEST_METHOD"]); }