So I was trying to do pagination with php, but I can't quite get it done, there is an error of undefined index page in it somewhere, I have no idea why...here is my code:
        <?php
            $perpage = 10;
            if (empty($_GET['page'])) {
                $page = 1;
            }else{
                $page = $_GET['page'];
            }
            $limitstart = $_GET['page'] - 1 * $perpage;
            $query = "SELECT * FROM images ORDER BY id DESC LIMIT '".$limitstart."', '".$perpage."' ";
            $result = mysqli_query($con,$query) or die(mysqli_error($con));
            while($row=mysqli_fetch_array($result)) {
        ?>
I appreciate your help in any way, thank you.
 
     
    