Bons dias pessoal.
tou aqui com um problema.
tou a criar uma pagina de pesquisa de produtos.
a pesquisa ta a funcionar perfeitamente. porem quando faço comprar um produto, ele reencaminha para outra página processa e pedido e redirecciona para a página anterior.
ate aqui tudo bem mas quand redirecciona para a pagina anterior o browser pede para confirmar a submissao do formulario.
a duvida é como fazer para que nao apareça a mensagem do browser e fazer que ele recarregue o form automaticamente?
Código (PHP):
tou aqui com um problema.
tou a criar uma pagina de pesquisa de produtos.
a pesquisa ta a funcionar perfeitamente. porem quando faço comprar um produto, ele reencaminha para outra página processa e pedido e redirecciona para a página anterior.
ate aqui tudo bem mas quand redirecciona para a pagina anterior o browser pede para confirmar a submissao do formulario.
a duvida é como fazer para que nao apareça a mensagem do browser e fazer que ele recarregue o form automaticamente?
Código (PHP):
<form action="" name="apagardados" method="post"></form>
<form action="" enctype="multipart/form-data" method="post" name="pesqavanc" id="pesqavanc" onsubmit="return verifica(this)">
<table align="center" width="700">
<tr>
<td width="150" class="pesquisat">Descrição :</td>
<td width="550" class="pesquisat"><input type="text" name="pesq" id="pesq" style="width:550px;" value="<?php echo $pesq ?>" /></td>
</tr>
<tr>
<td class="pesquisat">Referência :</td>
<td><input type="text" name="ref" id="ref" style="width:550px;" value="<?php echo $ref ?>" /></td>
</tr>
<tr>
<td class="pesquisat">Marca :</td>
<td>
<select name="marca" id="marca">
<option value="<?php echo $mar ?>"><?php echo $mar ?></option>
<option value="">-- Seleccione uma marca --</option>
<?php
$sql3 = "SELECT * FROM marcas ORDER BY Nome ASC";
$qr3 = mysql_query($sql3) or die(mysql_error());
while($ln3 = mysql_fetch_assoc($qr3))
{
?>
<option value="<?php echo $ln3['Nome'] ?>"><?php echo $ln3['Nome'] ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td class="pesquisat">Família :</td>
<td>
<?php
$sql = "SELECT * FROM familias ORDER BY Nome";
$res = mysql_query($sql);
$num = mysql_num_rows($res);
for ($i = 0; $i < $num; $i++)
{
$dados = mysql_fetch_array($res);
$arrFams[$dados['Nome']] = $dados['Nome'];
}
?>
<select name="fam" id="fam" onchange="buscar_subfams()">
<option value=""></option>
<?php
foreach ($arrFams as $value => $name)
{
echo "<option value='{$value}'>{$name}</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="pesquisat">SubFamília :</td>
<td>
<div id="load_subfams">
<select name="subfam" id="subfam">
<option value=""></option>
</select>
</div>
</td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" name="Enviar" id="Enviar" value=" Pesquisar " /><input name="Reset" type="submit" onclick="limpardados(); document.apagardados.submit();" value=" Limpar Dados " /></td>
</tr>
<tr>
<td class="pesquisat"> </td>
<td></td>
</tr>
</table>
<table align="center" width="100%">
<tr>
<td colspan="4" align="center" class="ordenarp">Ordenar por:</td>
</tr>
<tr>
<td class="ordenart" valign="top" align="center">Preço<input type="image" src="images/arrow-down.png" title="Preço Descendente" name="precodesc" value="precodesc" alt="precodesc" width="20" height="20"/><input type="image" title="Preço Ascendente" src="images/arrow-up.png" name="precoasc" value="precoasc" alt="precoasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Marca<input type="image" title="Marca Por Nome Z - A" src="images/arrow-down.png" name="marcadesc" value="marcadesc" alt="marcadesc" width="20" height="20"/><input type="image" title="Marca Por Nome A - Z" src="images/arrow-up.png" value="marcaasc" alt="marcaasc" name="marcaasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Referência<input type="image" title="Referência Por Nome Z - A" src="images/arrow-down.png" name="referdesc" value="referdesc" alt="referdesc" width="20" height="20"/><input type="image" title="Referência Por Nome A - Z" src="images/arrow-up.png" value="referasc" alt="referasc" name="referasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Descrição<input type="image" title="Descrição Por Nome Z - A" src="images/arrow-down.png" value="descdesc" name="descdesc" alt="descdesc" width="20" height="20"/><input type="image" title="Descrição Por Nome A - Z" src="images/arrow-up.png" name="descasc" value="descasc" alt="descasc" width="20" height="20"/></td>
</tr>
</table>
</form>
<form action="" enctype="multipart/form-data" method="post" name="pesqavanc" id="pesqavanc" onsubmit="return verifica(this)">
<table align="center" width="700">
<tr>
<td width="150" class="pesquisat">Descrição :</td>
<td width="550" class="pesquisat"><input type="text" name="pesq" id="pesq" style="width:550px;" value="<?php echo $pesq ?>" /></td>
</tr>
<tr>
<td class="pesquisat">Referência :</td>
<td><input type="text" name="ref" id="ref" style="width:550px;" value="<?php echo $ref ?>" /></td>
</tr>
<tr>
<td class="pesquisat">Marca :</td>
<td>
<select name="marca" id="marca">
<option value="<?php echo $mar ?>"><?php echo $mar ?></option>
<option value="">-- Seleccione uma marca --</option>
<?php
$sql3 = "SELECT * FROM marcas ORDER BY Nome ASC";
$qr3 = mysql_query($sql3) or die(mysql_error());
while($ln3 = mysql_fetch_assoc($qr3))
{
?>
<option value="<?php echo $ln3['Nome'] ?>"><?php echo $ln3['Nome'] ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td class="pesquisat">Família :</td>
<td>
<?php
$sql = "SELECT * FROM familias ORDER BY Nome";
$res = mysql_query($sql);
$num = mysql_num_rows($res);
for ($i = 0; $i < $num; $i++)
{
$dados = mysql_fetch_array($res);
$arrFams[$dados['Nome']] = $dados['Nome'];
}
?>
<select name="fam" id="fam" onchange="buscar_subfams()">
<option value=""></option>
<?php
foreach ($arrFams as $value => $name)
{
echo "<option value='{$value}'>{$name}</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="pesquisat">SubFamília :</td>
<td>
<div id="load_subfams">
<select name="subfam" id="subfam">
<option value=""></option>
</select>
</div>
</td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" name="Enviar" id="Enviar" value=" Pesquisar " /><input name="Reset" type="submit" onclick="limpardados(); document.apagardados.submit();" value=" Limpar Dados " /></td>
</tr>
<tr>
<td class="pesquisat"> </td>
<td></td>
</tr>
</table>
<table align="center" width="100%">
<tr>
<td colspan="4" align="center" class="ordenarp">Ordenar por:</td>
</tr>
<tr>
<td class="ordenart" valign="top" align="center">Preço<input type="image" src="images/arrow-down.png" title="Preço Descendente" name="precodesc" value="precodesc" alt="precodesc" width="20" height="20"/><input type="image" title="Preço Ascendente" src="images/arrow-up.png" name="precoasc" value="precoasc" alt="precoasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Marca<input type="image" title="Marca Por Nome Z - A" src="images/arrow-down.png" name="marcadesc" value="marcadesc" alt="marcadesc" width="20" height="20"/><input type="image" title="Marca Por Nome A - Z" src="images/arrow-up.png" value="marcaasc" alt="marcaasc" name="marcaasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Referência<input type="image" title="Referência Por Nome Z - A" src="images/arrow-down.png" name="referdesc" value="referdesc" alt="referdesc" width="20" height="20"/><input type="image" title="Referência Por Nome A - Z" src="images/arrow-up.png" value="referasc" alt="referasc" name="referasc" width="20" height="20"/></td>
<td class="ordenart" valign="top" align="center">Descrição<input type="image" title="Descrição Por Nome Z - A" src="images/arrow-down.png" value="descdesc" name="descdesc" alt="descdesc" width="20" height="20"/><input type="image" title="Descrição Por Nome A - Z" src="images/arrow-up.png" name="descasc" value="descasc" alt="descasc" width="20" height="20"/></td>
</tr>
</table>
</form>