Skip to content

Conversation

@GreeenPeppper
Copy link

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one
<a class="pagination prev" href="?page=<?php echo $page-1?>">« Previous page</a>
<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $x is not yet defined here. Also, it will only be 49 after the foreach loop (when looping over a full "page" of users).

<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
<a class="pagination next" href="?page=<?php echo ++$page?>">Next page »</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating the $page variable here means that it has the wrong value when used (and incremented again) later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants