I have an index.php
page from where I have included other pages with if statements as shown below.
<?php
if(isset($_GET['dashboard'])) {
include("dashboard.php");
}
if(isset($_GET['view_staffs'])) {
include("view_staffs.php");
}
if(isset($_GET['delete_staff'])){
include("delete_staff.php");
}
if(isset($_GET['edit_staff'])){
include("edit_staff.php");
}
if(isset($_GET['group_companies'])){
include("group_companies.php");
}
?>
I added paginations to the view_staff
page with the url loking like index.php?view_staff
so on adding the pagination code,
<?php
if($page_no > 1){
echo "<li><a href='?page_no=1'>First Page</a></li>";
} ?>
<li <?php if($page_no <= 1){ echo "class='disabled'"; } ?>>
<a <?php if($page_no > 1){
echo "href='?page_no=$previous_page'";
} ?>>Previous</a>
</li>
<li <?php if($page_no >= $total_no_of_pages){
echo "class='disabled'";
} ?>>
<a <?php if($page_no < $total_no_of_pages) {
echo "href='?page_no=$next_page'";
} ?>>Next</a>
</li>
<?php if($page_no < $total_no_of_pages){
echo "<li><a href='?page_no=$total_no_of_pages'>Last ››</a></li>";
} ?>
Whenever I click on next page, it shows a blank index.php?page_no=2
with no content
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…