How can the Blätterfunktion in the Searchsystem be fixed to function properly?

The Blätterfunktion in the Searchsystem can be fixed by ensuring that the pagination logic is correctly implemented. This involves calculating the total number of pages based on the search results and displaying the appropriate page numbers. Additionally, the query parameters should be properly passed to the next and previous pages to maintain the search context.

// Calculate total number of pages based on search results
$totalResults = // total number of search results
$resultsPerPage = // number of results per page
$totalPages = ceil($totalResults / $resultsPerPage);

// Display page numbers
for ($i = 1; $i <= $totalPages; $i++) {
    echo "<a href='search.php?page=$i'>$i</a>";
}

// Pass query parameters to next and previous pages
$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
$nextPage = $currentPage + 1;
$prevPage = $currentPage - 1;

echo "<a href='search.php?page=$nextPage'>Next</a>";
echo "<a href='search.php?page=$prevPage'>Previous</a>";