I'm working on a Web Search Engine project. I am working on the pagination feature. When I click on the page, it gives abrupt results and Undefined variable: page1 error
is given. What to do?
if(isset($_GET['page'])) //results displayed based on page selection
{
$page=$_GET['page'];
if($page=="" || $page=="1")
{
$page1=0;
}
else
{
$page1=($page*10)-10;
}
}
$numrows1 = mysqli_num_rows($query); // page evaluation and this statement calculates number of resultant rows
$a = $numrows1/10; //10 is for number of results per page and $a gives number of pages
$a = ceil($a);
echo "<br>"; echo "<br>";
for($b=1; $b<=$a; $b++)
{
?><a href="search.php?page=<?php echo $b; ?>" style="text-decoration:none;"><?php echo $b." ";?></a><?php
}
I hope I'm clear. Anyone can help me fix this?