Biel. 9 Denunciar post Postado Outubro 3, 2015 boa noite a todos. Pessoal o codigo abaixo me dar o seguinte resultado Se eu clicar no botão salvar que está na posição 5, vai exibir na tela A5 Se eu clicar no botão salvar que está na posição 8, vai exibir na tela A8 Gostaria que a palavra aprendiz ou qualquer palavra que eu digitasse no campo input também fosse exibida na tela quando eu clicasse no botão salvar <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $pega_button = $_POST['pega_button']; $nome = $pega_button; $tete = $_POST['tete']; $sql = mysql_query ("INSERT INTO tabela_aprendiz (nome, tete) VALUES ('".$nome."' , '".$tete."') ")or die (mysql_error()); echo $_POST['pega_button']; //echo "ok"; } ?> <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1" > <table width="339" border="0" align="left" cellpadding="4" cellspacing="4"> <?php $i = 0; while( $i < 9 ){ $i++; ?> <tr> <td width="144"><input type="text" name="nome" value="A<?php echo $i;?> "><input type="text" name="tete" value="aprendiz"></td> <td width="52"> <button type="submit" name="pega_button" value="A<?php echo $i; ?>">Salvar</button> <input type="hidden" name="MM_insert" value="form1" /> </td> <td width="35">posição </td> <td width="35"><?php echo $i;?></td> </tr> <?php }?> </table> </form> Compartilhar este post Link para o post Compartilhar em outros sites
LandersonAlmeida 31 Denunciar post Postado Outubro 3, 2015 Gente... Pelo que eu entendi, só descomentar o echo e colocar a palavra que você quiser... echo "Bla Bla Bla"; Compartilhar este post Link para o post Compartilhar em outros sites