<?PHP
include_once("../../cisweb_manual/valida_sessao.php");
protegePagina(); 
?>

<?PHP 
$campo = $_POST['campo'];
$busca = $_POST['busca'];
$qry = $_POST['qry'];
$arq = $_POST['arq'];
$sql = " ORDER BY $campo ASC";

if($busca!='*'){
	if($campo=='id'){
		$sql = " WHERE $campo = '$busca' ORDER BY $campo ASC";	
	}else{
		$sql = " WHERE $campo LIKE '%$busca%' ORDER BY $campo ASC";
	}
}
$qry = base64_decode($qry);
$resul = $qry.$sql;
$resul = base64_encode($resul);
?>

Buscando...

<form id="foo" name="buscar" action="<?=$arq?>" method="post">
<input type="hidden" name="qry" value="<?=$resul?>" />
</form>


<script type="text/javascript">
document.getElementById('foo').submit();
</script>