Good morning,
I have the following script that I need to save all textarea data line by line but the script saves only the first line and ignores the rest
I get the data like this in textarea
0001:0001:0001:0001
0001:0001:0001:0001
0001:0001:0001:0001
My code
<?php
if (isset($_POST['acao']) && $_POST['acao'] == 'cadastrar'):
$lista = strip_tags(filter_input(INPUT_POST, 'lista'));
list($a, $b, $c, $d) = explode(":", $lista);
$valor = strip_tags(filter_input(INPUT_POST, 'valor'));
$data = '21-05-2015';
$verificar_adm = BD::conn()->prepare("SELECT id FROM 'infocc' WHERE cc = ?");
$verificar_adm->execute(array($user));
if (!$val->validar()) {
$erros = $val->getErro();
echo '<div class="erros">Erro: ' . $erros[0] . '</div>';
} elseif ($verificar_adm->rowCount() > 0) {
echo '<br><br> <span align="center" class="help-block note"><i class="icon-warning-sign"></i> Duplicado.</span>';
} else {
$dados_cadastrar = array(
'n' => $n,
'a' => $a,
'b' => $b,
'c' => $c,
'd' => $d,
'v' => $v,
'f' => 'N'
);
if ($site->inserir('tabela', $dados_cadastrar)) {
echo '<br><br> <span align="center" class="help-block note"><i class="icon-warning-sign"></i> Ok</span>';
} else {
echo '<br><br> <span align="center" class="help-block note"><i class="icon-warning-sign"></i> Erro Grave, tente novamente.</span>';
}
}
endif;
?>
What should I do to save all logs?