karthika pommudu

karthika pommudu

  • NA
  • 321
  • 35k

Pagination signout when click next page

Mar 30 2020 4:41 AM
Whenever I click the next page in pagination icon/button,its jumped to signout.
 
Please advice and help me to clear this.
  1. $showRecordPerPage = 5;  
  2. if(isset($_GET['page']) && !emptyempty($_GET['page'])){  
  3. $currentPage = $_GET['page'];  
  4. }else{  
  5. $currentPage = 1;  
  6. }  
  7. $startFrom = ($currentPage * $showRecordPerPage) - $showRecordPerPage;  
  8. $totalEmpSQL = "SELECT * FROM feedback where id !='' and name!='' ";  
  9. $allEmpResult = mysqli_query($link$totalEmpSQL);  
  10. $totalEmployee = mysqli_num_rows($allEmpResult);  
  11. $lastPage = ceil($totalEmployee/$showRecordPerPage);  
  12. $firstPage = 1;  
  13. $nextPage = $currentPage + 1;  
  14. $previousPage = $currentPage - 1;  
  15. html code:  
  16. ---------------  
  17. <nav aria-label="Page navigation">  
  18. <ul class="pagination">  
  19. <?php if($currentPage != $firstPage) { ?>  
  20. <li class="page-item">  
  21. <a class="page-link" href="?page=<?php echo $firstPage ?>" tabindex="-1" aria-label="Previous">  
  22. <span aria-hidden="true">First</span>  
  23. </a>  
  24. </li>  
  25. <?php } ?>  
  26. <?php if($currentPage >= 2) { ?>  
  27. <li class="page-item"><a class="page-link" href="feedbacklist.php?page=<?php echo $previousPage ?>"><?php echo $previousPage ?></a></li>  
  28. <?php } ?>  
  29. <li class="page-item active"><a class="page-link" href="feedbacklist.php?page=<?php echo $currentPage ?>"><?php echo $currentPage ?></a></li>  
  30. <?php if($currentPage != $lastPage) { ?>  
  31. <li class="page-item"><a class="page-link" href="feedbacklist.php?page=<?php echo $nextPage ?>"><?php echo $nextPage ?></a></li>  
  32. <li class="page-item">  
  33. <a class="page-link" href="feedbacklist.php?page=<?php echo $lastPage ?>" aria-label="Next">  
  34. <span aria-hidden="true">Last</span>  
  35. </a>  
  36. </li>  
  37. <?php } ?>  
  38. </ul>  
  39. </nav>  

Answers (2)