I want to receive the form data with loop, I found an example like this:
foreach($_POST as $nome_campo => $valor) {
$comando = "$" . $nome_campo . "='" . $valor . "';";
eval($comando);
}
But I do not know how I can do to save or edit this data in the database.
I do not know if it is possible, because this variable $comando
does not show me anything outside foreach
.
I want to get:
Name, email, password, obs via _POST of the form and add in the bank using a loop, not to do:
$nome = $_POST['nome'];
$email = $_POST['email']
...
and have this data stored in the database.