Whenever I click the next page in pagination icon/button,its jumped to signout.
Please advice and help me to clear this.
- $showRecordPerPage = 5;
- if(isset($_GET['page']) && !emptyempty($_GET['page'])){
- $currentPage = $_GET['page'];
- }else{
- $currentPage = 1;
- }
- $startFrom = ($currentPage * $showRecordPerPage) - $showRecordPerPage;
- $totalEmpSQL = "SELECT * FROM feedback where id !='' and name!='' ";
- $allEmpResult = mysqli_query($link, $totalEmpSQL);
- $totalEmployee = mysqli_num_rows($allEmpResult);
- $lastPage = ceil($totalEmployee/$showRecordPerPage);
- $firstPage = 1;
- $nextPage = $currentPage + 1;
- $previousPage = $currentPage - 1;
- html code:
- ---------------
- <nav aria-label="Page navigation">
- <ul class="pagination">
- <?php if($currentPage != $firstPage) { ?>
- <li class="page-item">
- <a class="page-link" href="?page=<?php echo $firstPage ?>" tabindex="-1" aria-label="Previous">
- <span aria-hidden="true">First</span>
- </a>
- </li>
- <?php } ?>
- <?php if($currentPage >= 2) { ?>
- <li class="page-item"><a class="page-link" href="feedbacklist.php?page=<?php echo $previousPage ?>"><?php echo $previousPage ?></a></li>
- <?php } ?>
- <li class="page-item active"><a class="page-link" href="feedbacklist.php?page=<?php echo $currentPage ?>"><?php echo $currentPage ?></a></li>
- <?php if($currentPage != $lastPage) { ?>
- <li class="page-item"><a class="page-link" href="feedbacklist.php?page=<?php echo $nextPage ?>"><?php echo $nextPage ?></a></li>
- <li class="page-item">
- <a class="page-link" href="feedbacklist.php?page=<?php echo $lastPage ?>" aria-label="Next">
- <span aria-hidden="true">Last</span>
- </a>
- </li>
- <?php } ?>
- </ul>
- </nav>