Good afternoon, I'm new to this area and I'm having trouble getting my html form data with my PHP code. My problem is that I am using the Inputs name format the following format name="data [Curriculum] [name]" however when I enter the Input name in my Php code it does not receive the data. Here is the code I'm using, others I've tried as possible solutions:
<html>
<head>
<title></title>
</head>
<body>
<form id="formAddCurriculo" class="form-default" enctype="multipart/form-data" method="post" action="conexão.php" accept-charset="utf-8">
<div style="display:none;"><input type="hidden" name="_method" value="POST" /></div>
<h5 class="title-field whit-padding">Dados Pessoais</h5>
<fieldset class="clearfix mbottom sides-margin">
<div class="input text">
<label for="CurriculoName" class="required">Nome Completo</label>
<input name="data[Curriculo][name]" type="text" class="field field-big" maxlength="255" id="CurriculoName" /></div>
<div class="input text">
<label for="CurriculoRg">RG</label>
<input name="data[Curriculo][rg]" type="text" class="field field-medium" maxlength="14" id="CurriculoRg" /></div>
<div class="input text required">
<label for="CurriculoCpf" class="required">CPF</label>
<input name="data[Curriculo][cpf]" type="text" class="field field-medium cpf" maxlength="50" id="CurriculoCpf" /></div>
<fieldset class="clearfix sides-margin">
<div class="submit"><input class="to-upper fright btn-green ts" type="submit" value="Cadastrar" /></div>
</fieldset>
</form>
</body>
</html>
PHP
<?php
$servername = "localhost";
$database = "**********";
$username = "***********";
$password = "************";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
// RECEBENDO OS DADOS PREENCHIDOS DO FORMULÁRIO !
$data[Curriculo][name] = $_POST ['$data[Curriculo][name]'];
$data[Curriculo][rg] = $_POST ['data[Curriculo][rg]'];
$data[Curriculo][cpf]f = $_POST ['data[Curriculo][cpf]'];
$Usuarios = "INSERT INTO Usuarios (ID,NomeCompleto, RG, CPF)VALUES((Null,'$data[Curriculo][name]','data[Curriculo][rg]','data[Curriculo][cpf]')";
if (mysqli_query($conn, $Usuarios)) {
echo "New record created successfully";
} else {
echo "Error: " . $Usuarios . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
But you do not get input data, I know it may seem obvious but I could not find the solution in the PHP documentation, and I would not like to rename the Inputs because I have the javascript validation codes and the sheet of style written in this format