Notice: Undefined index:

Помогите, пожалуйста, исправить ошибку.

    require_once 'getRecipes.php';
    require_once 'countIngridients.php';

    if($_POST['recipe']!="") {
        $recipes=getRecipe();
        $newRecipe = array("id" => uniqid(), "recipe" => $_POST['recipe']);
        array_push($recipes, $newRecipe);
        file_put_contents('../../data/recipes.txt', json_encode($recipes, true));
        // header('Location: http://' . $_SERVER['HTTP_HOST'] .$_SERVER['REQUEST_URL']);
        $recipes = getRecipe();
        $outpup = [];
        foreach ($recipes as $key=>$value) {
            $value['count'] = countIngridients($value["id"]);
            array_push($outpup, $value);
        }
        echo json_encode($outpup);
    }```

Notice: Undefined index: recipe in /home/user_7/html/LabWeb7/lib/php/putRecipe.php on line 5

Ответы (0 шт):