Form system by base date how to get data in $ _POST

0

How to format

► Put returns between paragraphs

► For line breakage add 2 spaces at the end

Italic or bold

► Retrieve the code in 4 spaces

► Serpent escapes parecido _portanto_

► highlighting by placing > at the beginning of the line

► to make links

link foo foo

► Basic HTML is also allowed

help in format

    
asked by anonymous 01.05.2017 / 21:05

2 answers

0
if (isset($_POST['nome']))
{
   foreach($_POST['nome'] as $key => $value)
   {
       echo 'Nome: '.$value;
       echo '<hr/>';
   }
}
    
01.05.2017 / 21:18
0

I tested your code with update how it would look to work:

   <code>
       <?php   
        require_once('Connections/localhost.php'); 
        if (isset($_POST['acao'])) {
            if (isset($_POST['nome'])) {
                reset($_POST['nome']); 
                while (list($key, $val) = each($_POST['nome'])) {  
                      //echo "$key => $val\n";  
                      mysql_select_db($database_localhost, $localhost);
                      $gostou = mysql_query("update tab_statusoperacao SET DESCRICAO = '$val' WHERE CODSTATUSOPERACAO = '$key' ");

                }
            }
        }
        ?>

        <form method="post" enctype="multipart/form-data" style="margin-bottom:5px"> 
            <input type="hidden" name="acao" id="acao" value="1" /> 
            <?php
            mysql_select_db($database_localhost, $localhost);
            $get_form = mysql_query("SELECT * FROM tab_statusoperacao") or die(mysql_error());
            while ($form = mysql_fetch_assoc($get_form)) { ?>
              <p>
                <label class="label-form" for="<?php echo $form['CODSTATUSOPERACAO']; ?>"><?php echo $form['DESCRICAO']; ?></label>
                <br />      
                <input type="text" name="nome[<?php echo $form['CODSTATUSOPERACAO']; ?>]" id="<?php echo $form['CODSTATUSOPERACAO']; ?>" class="input-form" value="<?php echo $form['DESCRICAO'];?>" />
                <br />  
              </p>
            <?php } ?>
            <input type="submit" name="enviar2" class="input-form" value="Enviar" />
        </form> 
    </code>
    
02.05.2017 / 14:09