Link to home
Start Free TrialLog in
Avatar of peps03

asked on

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


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?
Avatar of Derokorian
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peps03


Works like a charm!