0
I have this form.
<form>
<input type="text" name="nome">
</form>
It would take the value of $_POST
in php automatically?
I need to get the data from a form where I don’t know the names of the fields or the amount.
<form method="post">
<input type="text" name="nome">
<input type="text" name="outro-campo">
<input type="text" name="outro-campo2">
</form>
Instead of doing
echo $_POST['nome'];
echo $_POST['outro-campo'];
echo $_POST['outro-campo2'];
I need something automatic but I don’t know how.
Could you please explain better what you need? your question is not clear enough.
– Rafael Augusto
If there were, it would be like trading six for half a dozen.
– user60252
What do you mean automatically? Magically go to another page and already drop to (example) a variable called $name?
– UzumakiArtanis
I could not understand very well what you want ... it seems to me that the nearest would be the use of function
extract()
it converts an array into variables (the names are the keys) but if it is not treated well or has not much control of the situation opens security loopholes similar to the Register globals– rray