Fiz um pequeno ajuste para não sobreescrever o arquivo json existente.
<?php
$filme = [
'nome' => $_POST['nome'],
'anoLancamento' => $_POST['anoLancamento'],
'nota' => $_POST['nota'],
'genero' => $_POST['genero']
];
if (file_exists('filmes.json')) {
$conteudoArquivo = file_get_contents('filmes.json');
$filmes = json_decode($conteudoArquivo, true);
if (!$filmes) {
$filmes = [];
}
} else {
$filmes = [];
}
$filmes[] = $filme;
file_put_contents('filmes.json', json_encode($filmes, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
header('Location: /sucesso.php?filme=' . $filme['nome']);