<?php include "php/cabecera.inc";
	echo "<div><BR>";
	
	if($_POST['CAT'])
	{
		$_SESSION['C'] = $_POST['CAT'];
		$consulta= "SELECT * FROM PRODUCTOS WHERE DEPTO = '".$_SESSION['C']."' AND PRECIO>0 ORDER BY RAND()";
		}else{
		$consulta= "SELECT * FROM PRODUCTOS WHERE PRECIO>0 ORDER BY RAND() LIMIT 0,40";
	}
	$_SESSION['C']=$_POST['CAT'];
	$conexion = mysqli_connect($serv,$dbu,$dbp,$db);
	mysqli_set_charset($conexion, "utf8");
	$resultado = mysqli_query($conexion, $consulta);
	mysqli_close($conexion);
include "php/pie.inc" ?>