Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia pessoal.
Sou iniciante em PHP e estou criando um formulário para minha empresa. Tudo que fiz foi pesquisando no Google, copiando, colando e adaptando para minha necessidade.
Enfim... A tabela/formulario é esta:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img221.imageshack.us/img221/1047/43949674.png&key=e7f6d96ec553ca5e83f38091cbfafaa5514b4b370ec411770c369647ccfc004f" alt="43949674.png" />
Index.php:
<body>
<center><img src="img/logo.png" /></center>
<br />
<div id="formulario">
<?php
echo "Olá, " . $_SESSION['usuarioUsuario'];
?>
</div>
<br />
<div id="tabela">
<table border="2" bordercolor="#650000">
<tr>
<th>COD. INOVE (5 digitos)</th>
<th>UF</th>
<th>COMARCA</th>
<th>AUTOR</th>
<th>DATA DA CONCLUSAO</th>
<th>VALOR DO ATO</th>
<th>KMs</th>
<th>VALOR TOTAL DESPs.</th>
<th>TIPO DESPs.</th>
</tr>
<?php
include("tabela.php");
?>
</table>
</center>
</div>
</body>
tabela.php:
<div>
<form action="tabela2.php" method="post" name="form">
<tr>
<td><input type="text" name="cod" id="cod" maxlength="5" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'" onkeypress="return numero(event)" size="25"></td>
<td>
<select name="cod_estados" id="cod_estados">
<option value="">--</option>
<?php
$sql = "SELECT sigla, cod_estados
FROM estados
ORDER BY sigla";
$res = mysql_query( $sql );
while ( $row = mysql_fetch_assoc( $res ) ) {
echo '<option value="'.$row['cod_estados'].'">'.$row['sigla'].'</option>';
}
?>
</select></td>
<td>
<select name="cod_cidades" id="cod_cidades" style="width: auto; min-width: 200px !important;" OnKeyPress="formatar('#####', this)">
<option>SELECIONE O ESTADO</option>
</select>
</td>
<td><input type="text" name="autor" id="autor" size="30" onKeyPress="javascript:retiraAcento(this);" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'"></td>
<td><input type="text" name="dataconcl" size="22" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'" OnKeyPress="formatar('##/##/####', this)" maxlength="10"></td>
<td><input type="text" name="valorato" size="15" maxlength="10" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'" onkeypress="return virgula( this , event ) ;"></td>
<td><input type="text" name="kms" size="10" maxlength="3" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'" onkeypress="return virgula( this , event ) ;"></td>
<td><input type="text" name="valordesp" size="22" maxlength="6" onfocus="this.style.backgroundColor='#cd8080'" onblur="this.style.backgroundColor='#fff'" OnKeyPress="formatar('000,00', this)"></td>
<td><select name="descricaodesp" id="descricaodesp" style="width: auto; min-width: 120px !important;">
<option value=""></option>
<option value="pedagio">PEDAGIO</option>
<option value="correio">CORREIO</option>
<option value="guia">GUIA</option>
<option value="impressoes">IMPRESSOES</option>
<option value="xerox">XEROX</option>
<option value="2oumaisdesp">2 OU MAIS DESP.</option>
</select></td>
</tr>
<input type="submit" class="submit" value=" Enviar ">
</form>
</div>
Para chegar a esta pagina há uma tela de login e senha em SESSION.
Gostaria que conforme o usuario "X" preenchesse e enviasse as informações pro banco de dados, elas fossem exibidas na parte de baixo do da tabela, como se inserisse uma linha na tabela, mas que exibisse somente as informações enviadas por essa SESSION.
Nao sei se expliquei bem, mas qualquer duvida estou a disposição.
Obrigado desde já!
Carregando comentários...