[Resolvido] foreach POST array
estou tentando pegar variaveis de um formulario com array
estou tentando a seguinte linha
foreach($_POST["quantidade"] as $quantidade) { $$quantidade = $quant; echo $quant[$i]; $i++}
e meu formulari de envio é o seguinte
<form id="compras" name="compras" method="POST" action="<?php echo $editFormAction; ?>">
<input name="id_operador" type="hidden" value="<?php echo $row_nome_operador['id']; ?>" />
<?php do { ?>
<div id="produto">
<table width="345" border="0">
<tr>
<td width="100"><input name="id[]" type="hidden" value="<?php echo $row_produtos['id']; ?>" /><img src="imagens/produtos/<?php echo $row_produtos['img']; ?>" width="100" height="90" /></td>
<td width="235" valign="top"><span class="nome_produto"><?php echo $row_produtos['nome']; ?></span><br />
<span class="valor_produto">VALOR: <?php echo $row_produtos['valor']; ?><input name="valor[]" type="hidden" value="<?php echo $row_produtos['valor']; ?>" /></span><br />
<span class="quantidade_produto">Quantidade:
<input style=" margin-top:-50;S" name="quantidade[]" type="text" class="input_quantidade" id="quantidade" onFocus="if(this.value=='00')this.value='';" onBlur="if(!this.value)this.value='00';" value="00" />
</span></td>
</tr>
</table>
</div>
<?php } while ($row_produtos = mysql_fetch_assoc($produtos)); ?>
<div style="clear:both;"></div>
<label>
<input type="submit" name="comprar" id="comprar" value="COMPRAR" />
</label>
<input type="hidden" name="MM_insert" value="compras" />
</form>Discussão (13)
Carregando comentários...