Receive form name or submit PHP

0

How can I receive the form name or submit via POST in another function?

<form class="form-inline" name="indicador" method="post" action="funcoes/indicadores.php" >

   <button type="submit" class="btn btn-theme" name="indicador">Atualizar</button>

</form>

The name="" that I will use will be dynamic, and when I get the POST on the page functions / pointers.php I want to know the name of the POST or SUBMIT ...

    
asked by anonymous 05.11.2015 / 19:18

2 answers

1

Gathering the form name is not possible. I find it easier to put a hidden field with the name of the form, then you get that field, or also get the name or value of the submit button.

    
05.11.2015 / 19:22
1

I suggest using a hidden field, this type of field is invisible to the user, that is, it will not appear on the screen.

Example:

In this case, you place the dynamic value in the "value" attribute of the input. Already to get this value through POST, just use:

$ dynamic_value = $ _POST ['example'];

I hope I have helped.

    
05.11.2015 / 20:30