Ver Mensaje Individual
  #8 (permalink)  
Antiguo 10/09/2013, 03:22
Novato2013
 
Fecha de Ingreso: junio-2013
Ubicación: Madrid
Mensajes: 61
Antigüedad: 10 años, 10 meses
Puntos: 5
Respuesta: Paginación con filtros casi acabada, pequeño fallito q me atasca

Ya lo he arreglado, lo pongo por si le sirve a alguien. Lo he arreglado con el comando $_SESSION q me permite guardar el valor seleccionado del usuario para las diferentes páginas y durante más tiempo que $_POST y $_GET, he modificado todos mis filtros d la siguiente forma:

Código PHP:
Ver original
  1. //Category
  2. if (isset ($_POST['CategoryInput'])) {
  3.     $CategoryInput = $_POST['CategoryInput'];
  4. } elseif (isset( $_SESSION['filter']['CategoryInput'] )) {
  5.     $CategoryInput = $_SESSION['filter']['CategoryInput'];
  6. } else {//Nothing
  7. }
  8.  
  9. if (isset($CategoryInput)) {
  10.  
  11.     if ($CategoryInput !=''){
  12.         $_SESSION['filter']['CategoryInput'] = $CategoryInput;                                                    
  13.         if($DataFilter!="") {
  14.             $DataFilter .= " AND ";
  15.         }
  16.         $DataFilter .= "category_id = '" . $CategoryInput . "' ";
  17.     }    
  18. }else {
  19.     $CategoryInput = '';
  20. }

Y mi form, donde muestro por pantalla mis filtros y donde tengo metido el botón buscar he cambiado la primera línea la parte del action por lo siguiente:

Código HTML:
Ver original
  1. <form method="POST" action="<?=$_SERVER['REQUEST_URI']?>">

Mi línea de paginación de mi último post estaba correcta, no es necesario meter el filtro ahi ya con el comando $_SESSION.

Con lo dicho en este último post y todos los anterios teneis una paginación filtrada completa , espero q sirva a los q anden buscando algo parecido ;)