I have the following cycle that converts the data received for POST
at once without assigning it to an Ejm variable:
////Envio $_POST['name']='valentina'
and with
if(@$_POST)
{
foreach($_POST as $campo => $valor)
{
$asig = "$" . $campo . "='" . htmlspecialchars($valor,ENT_QUOTES) . "';";
eval($asig);
}
echo $name // $name = valentina
}
But for security reasons I want to remove the function eval()
How can I replace the function eval()
? or what other method can I use to replace the foreach
?