I have a form where text fields are created dynamically with the names unknown. I am trying to get those text fields names and values and using the following PHP code.
foreach ($_POST as $key => $entry)
{
if (is_array($entry))
{
foreach($entry as $value)
{
print $key . ": " . $value . "<br>";
}
}
else
{
print $key . ": " . $entry . "<br>";
}
}
But the problem is that it gets all the hidden fields and submit button values as well. How can I prevent that from happening?
1 Answer