In my PHP code, even with MySQL and Apache connected, the error appears
Notice: Undefined index: name in C: \ xampp \ htdocs \ store \ add-product.php on line 4
Notice: Undefined index: price in C: \ xampp \ htdocs \ shop \ add-product.php on line 5
I think the message is talking about the GET request, I got my code and from what I saw it has no error. How could I fix the code?
Code:
<?php include("cabecalho.php"); ?>
<?php
$nome = $_GET["nome"];
$preco = $_GET["preco"];
?>
<p class="alert-sucess">
Produto <?= $nome; ?>, <?= $preco; ?> adicionado com sucesso!
</p>
<?php include("rodape.php"); ?>