Pessoal, tenho uma tabela que pretendo preencher após a atualização de um dropdown, eu clicando em um botão, ele preencha a minha tabela, é possível?
Estou utilizando o método GET para capturar o dado preenchido no dropdown e filtrar.
Segue o que eu tentei fazer e não funcionou. (Sou iniciante em PHP e programo sem orientação a objetos).
///MEU DROPDOWN
<select name="estados" id="estados" class="form-control input-sm">
<option value="0">---Selecione---</option>
<?php
$result = mysql_query("select ESTADO, id_rede from indicadores_rv where user = '".$_SESSION['usuarioNome']."'");
while($row = mysql_fetch_array($result) ){
echo "<option value='".$row['id']."'>".$row['ESTADO']."</option>";}
?>
</select>
///BOTÃO QUE CLICO PARA VALIDAR DADOS
<button class="btn btn-md btn-success btn-block" href="carrega_dados.php" type="submit">Carregar dados</button>
///CARREGA_DADOS.PHP
<?php session_start();
require "conecta.php";
$dados = mysql_query("select * from estudo where user = '".$_SESSION['usuarioNome']."' and estado = '".$_GET['estados']."'");
while($row = mysql_fetch_array($dados)){
$_session['valor1'] = echo $dados['numCpfs'];
header("Location: index.php"); ?>
///TABELA
<?php include(carrega_dados.php); ?>
<div class="table-responsive">
<table class="table table-hover table-bordered table-striped" id="tabela_formatada">
<thead>
<tr>
<th id="tab3"><b>D-1</b></th>
</tr>
</thead>
<tbody>
<tr>
<td id="tab99"><b># CPF Enviados</b></td>
<td id="tab0"><b><?php echo $_session['valor1']; ?></b></td>
</tr>
</tbody>
</table>
</div>
<?php
}
?>