receber variável no iframe
Boa tarde Srs,
eu gostaria que minha página onde existem 2 iframes ,mostrasse relatórios através de uma variável enviada .
segue abaixo os arquivos.
formulario1.php
<form name="busca" method="post" action="relatorio2.php" target="pesquisa">
<table >
<tr>
<td><input type="text" name="material" style="width:85%;font-family:arial;font-size:10" placeholder="" value="">
<BR>
<input type="submit" name="botao" value="Pesquisar" class="btn btn-success" style="width:98%;font-family:arial;font-size:10" >
</td>
</tr>
</table>
</form>
no formulario2.php
<?php $material=$_POST['material'];
echo $material; ?>
<table id='form' class="table table-striped table-bordered table-hover" >
<tr>
<Td>
<iframe src="info1.php" name="pesquisa" width="500" height="3550" scrolling="yes" frameborder="0" style="border:0px"></iframe>
</td>
<Td>
<iframe src="info2.php" name="pesquisa" width="500" height="3550" scrolling="yes" frameborder="0" style="border:0px"></iframe>
</td>
</tr>
</TABLE>
no arquivo info1.php
<table id='form' class="table table-striped table-bordered table-hover" >
<!-- linhas -->
<tr>
<th width='25%'>
MATERIAIS
</th>
<th width='25%'>
N DE SERIE
</th>
<?php
$material=$_POST['material'];
$sql = "SELECT * FROM material WHERE
material='$material' ";
$res = mysql_query($sql);
while($linha = mysql_fetch_array($res)){
?>
<tr>
<td>
<font color='green'> <?php echo $linha['material'];?>
</td>
<td>
<font color='green'> <?php echo $linha['serie'];?>
</td>
</tr>
<?php
}
?>
</table>
no info2.php
<table id='form' class="table table-striped table-bordered table-hover" >
<?php
$material=$_POST['material'];
?>
<!-- linhas -->
<tr>
<th width='25%'>
MATERIAIS
</th>
<th width='25%'>
N DE SERIE
</th>
<?php
$material=$_POST['material'];
$sql = "SELECT * FROM vendas WHERE
material='$material' AND status='VENDIDO' ";
$res = mysql_query($sql);
while($linha = mysql_fetch_array($res)){
?>
<tr>
<td>
<font color='green'> <?php echo $linha['material'];?>
</td>
<td>
<font color='green'> <?php echo $linha['serie'];?>
</td>
</tr>
<?php
}
?>
</table>
se puderem ajudar...Discussão (4)
Carregando comentários...