-3
In my PHP code, even with Mysql and Apache linked, error appears
Notice: Undefined index: name in C: xampp htdocs store add-product.php on line 4
Notice: Undefined index: preco in C: xampp htdocs loja adiciona-produto.php on line 5
I believe the message is talking about the GET type request, I took 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"); ?>
You know what the
$_GET["nome"]
makes? Could explain me with your words in a succinct way?– Woss
I believe it serves to store the "user" data typed by the user, in case the name of the product described by him.
– Romano
And where is this data? Where does PHP pull the values of this variable?
– Woss