I
I
Iron_Big_Cat2020-05-17 22:21:24
PHP
Iron_Big_Cat, 2020-05-17 22:21:24

How to make a site with page switching, like in online stores?

I am developing a website that displays cards with information that is taken from the database. But I need to have page switches at the bottom (1, 2, 3, etc. until the last card). It is important that I write without CMS. Here is an example of switching pages of this type of site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2020-05-17
Tkachik @Artemogirock

The simplest thing that comes to mind:
Decide how many cards to display on one page. Depending on the number of cards - number of cards / number on 1 page = number of pages.
Output links to pages with a get variable. For example my-site.com?page=1
On the page itself, you get the page variable get and substitute it into the card output loop. If 1, then display from 1 to 10 (for example). If 2 then output from 10 to 20 and TD.
I hope I understood the question correctly and explained it clearly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question