This is my code:
$tag1 = $_GET['tag1'];
$tag2 = $_GET['tag2'];
$stmt = $conn->prepare("SELECT name FROM info WHERE tag1='$tag1' OR tag2='$tag2' LIMIT $limit OFFSET $start");
// Pagination
while ($pagenumber != $totalpages)
{
++$pagenumber;
echo "<a href='?page=".$pagenumber."'>".$pagenumber."</a>";
}
Everything is working fine, but when i go to any other page, I get this 2 errors:
Notice: Undefined index: tag1
Notice: Undefined index: tag2