<?PHP
include_once("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";
	}
}

?>

Buscando...

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


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