include('../include/config.php'); include('functions/mercatino.php'); include('functions/search.php'); include_once('../functions/utility.php'); ?> $cosa = ''; $cat = ''; $order = 'data'; $page = $_GET['page']; $annunci = array(); //paginazione if (!(isset($page))) { $page = 1; } $page_rows = 10;//numero annunci per pagina if ($page < 1) { $page = 1; } $num_results = 0; $pagenum = $page -1; $query_page = 'LIMIT ' .$pagenum * $page_rows .',' .$page_rows;//stringa query LIMIT x,n $category = $_GET['cat']; $category = str_replace("-", " ", $category); $cat = get_category_id_by_name($category); $cat = (int) $cat; if(!empty($_GET['submitmercatino']) && $_GET['submitmercatino']=='cercamercatino'){ $cosa = htmlentities($_GET['cosa']); $dove = htmlentities($_GET['dove']); $annunci = search($cosa,$dove,$cat, $query_page); }else{ $annunci = search($cosa,$dove,$cat, $query_page); } ?>