Jump to content
Larry Ullman's Book Forums

Filter Paginated Results With Checkboxes - Where To Start


Recommended Posts

Hi HartleySan,

 

I have been “echoing out” the variables and the problem seems to be the $start and $_GET['s'] variables.

 

When a checkbox has been selected, the page will load and display a certain number of pagination links (numbers) depending on the total number of results. I now click to page 4 (as an example). On page 4, I select another checkbox and load the page. The page will load but will display the same current pagination link as before I selected a new checkbox. The  $_GET['s2'] variable already has a value of 4 and so this value is assigned to the $start variable. I don't know if I can use a loop to say that every time the $string variable is set the below code will run from the beginning again.

// Determine where in the database to start returning results...
if (isset($_GET['s']) && is_numeric($_GET['s'])) {
        $start = $_GET['s'];
} else {
        $start = 0;
}

Will keep on trying.

 

 

Thank you for your help.

Link to comment
Share on other sites

 Share

×
×
  • Create New...