You seem to never set the page unless you have a page in the URI.
I'm assuming if you used "page.php?page=1" it wouldn't throw that error since $page1 would be set.
I would personally do this:
if(isset($_GET['page']) && $_GET['page'] != 1)//if page is set and page doesn't equal 1
{
$startingRecord = ($_GET['page'] * 10) - 10;
}
else
{
$startingRecord = 0;
}
Also, I switched $page1
to be $startingRecord
to make more sense, as you are calculating the starting record, not the page.