php - Retrieve POST items with different names -


i'm passing values post file. 1 (or more) of values are: equip1, equip2, equip3, ..., equipn

i'm able know how many equipn have, not know how values. thought works, it's not:

for ($equip_aux=1; $equip_aux<=$number_of_equip; $equip_aux++) {     $aux = "'equipamento".$equip."'";     $value = $_post[$aux]; } 

any help, please?

i'm able know how many equipn have, not know how values.

here's corrected version of loop:

for ($i = 1; $i <= $number_of_equip; $i++) {     $aux = "equip$i";      $value = $_post[$aux]; } 

notice can loop trough post values foreach:

foreach ($_post $p) {     ... } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -