Check checkbox data that has variable names

3

I have a routine in PHP that generates a list with ten to fifteen names, and together with each name generates a checkbox that should be checked in case there is a lack of work for that name, if there is no lack of work the box does not is marked, and at the end of the conference, the list is sent.

How to get check box names that have not been marked, since the names of each check box are assigned to them through variables?

Note that it is very easy to receive from a form the data of a checkbox when it has a fixed name, this I know how to do, note in the code below that check boxes do not have fixed names, the action "confereescala.php" has which receives the unchecked check box names.

<form name="" method="Post" action="confereescala.php">
            <ul>
            <?php
            //recebe de outra pagina o nome da equipe de hoje
            $nomeEquipe = $_post['equipe'];

                    // bloco faz a busca na tabela empregados procurando empregados que sejam da equipe que foi enviada
                    $sqa = "SELECT * FROM 'empregados' WHERE ('equipe' = '".$nomeEquipe."')  ";
                    $sqb = mysql_query($sqa);
                    $num = mysql_num_rows($sqb);


                // faz o loop imprimindo na tela os nomes encontrados e os checkbox que sao da equipe encontrada
                //observe que cada check box recebe um nome diferente, que é dado pela variavel $empregadosdehoje['nome']
            while ($empregadosdehoje = mysql_fetch_array($sqb);){ ?>


                <li><a><input type="checkbox" size="8" name='<?php echo $empregadosdehoje['nome'] ; ?>'> <?php echo $empregadosdehoje['nome'] ; ?> </a></li>



            <?php } //fecha o while ?>
            <input class="button" type="submit" value="conferencia"/>
            </ul>
            </form>
    
asked by anonymous 26.01.2016 / 20:06

1 answer

2

You could create an input hidden at the time of creating the checkboxes. Ai on the next page you get all hidden, but alas just compare with the checkbox. I find this method easier.

 <input type="hidden" name="anexoDown" id = "anexoDown">
    
28.01.2016 / 11:11