Avatar of peps03
peps03
 asked on

PHP: switch through user details based on userid in url with previous and next buttons

Hi,

On my first page i have a list of users, say 7. when one is clicked on you get to see his details.
Now, the userid for which the information is needed is sent via the url: ?userid=1.
(but only of 1 user)

What i'm trying to do is, when on the detail page of a user, create a previous and a next button to switch between the detail pages without having to go back to the overview page.

how do i pass the correct userids to the links of the previous and next buttons?

should i grab the userid's on every page from the db and assign the one before the current to the previous button and the following id to the next button? (if so, how do i get the previous and following userids from a string?)

or is there a better method?
PHP

Avatar of undefined
Last Comment
peps03

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Derokorian

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
peps03

ASKER
Thanks!!
Works like a charm!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck