在刷新和重载会话变量值在php中增加

I created a page which have two button next and previous next is increasing the session value and previous is decreasing the session value, but when I refresh or reload the page the session value is increasing and decreasing which is the problem, I need session value increase and decrease only when I press the next / previous button is there any way to separate both sessions.

<?php
$db = mysqli_connect('localhost','root','root','rahul');
session_start();
    
if(empty($_SESSION['count']))
   $_SESSION['count'] = 0;
   
if(isset($_POST['sub1'])) {
    $order =  $_SESSION['count']+1;
    echo $order;
    $_SESSION['count'] = $order; 
    $sql = (" SELECT * FROM qna WHERE id = $order ");
    
    $query = mysqli_query($db, $sql);
    $row=mysqli_fetch_array($query, MYSQLI_ASSOC);
    
    $disable="";
    $disable2="";
    
    if($_SESSION['count'] >= 5) {
        $disable = "disabled";
    }
    if($_SESSION['count']<=1) {
        $disable2 = "disabled";
    }

    echo '<form action="" method="post">
              <table border="1" height="300px" width="500px">
                 <tr>
                     <th colspan="2">Q'. $row['id'].":   ".$row['questions'].'</th>
                 </tr>
                 <tr>
                     <td><input type="radio" value="" name="ans">'.$row["o1"].'</td>
                     <td><input type="radio" value="" name="ans">'.$row['o2'].'</td>
                 </tr>

                 <tr>
                     <td><input type="radio" value="" name="ans">'.$row['o3'].'</td>
                     <td><input type="radio" value="" name="ans">'.$row['o4'].'</td>
                 </tr>

                 <tr colspan="2">
                     <td><center><input type="submit" name="sub1" value="next" ' .$disable.'> </td>
                     <td><center><input type="submit" name="sub2" value="previous" ' .$disable2.'></td>
                 </tr>
             </form>
        </table>
';

 } 
?>

 <?php 
 
 if(isset($_POST['sub2'])) {
     $result2 = $_SESSION['count']-1;
     $_SESSION['count'] = $result2;
 
     $sql = (" SELECT * FROM qna WHERE id = $result2 ");
     $query = mysqli_query($db, $sql);
     $row=mysqli_fetch_array($query, MYSQLI_ASSOC);
        
     $disable2 = "";
     if($_SESSION['count'] <= 1) {
         $disable2 = "disabled";
     }
     if($_SESSION['count'] >= 5) {
         $disable = "disabled";
     }

     echo '<form action="" method="post" >
                <table border="1" height="300px" width="500px">
                    <tr>
                        <th colspan="2">Q'. $row['id'].":   ".$row['questions'].'</th>
</tr>

                    <tr>
                        <td><input type="radio" value="" name="ans">'.$row["o1"].'</td>
                        <td><input type="radio" value="" name="ans">'.$row['o2'].'</td>
                    </tr>

                    <tr>
                        <td><input type="radio" value="" name="ans">'.$row['o3'].'</td>
                        <td><input type="radio" value="" name="ans">'.$row['o4'].'</td>
                    </tr>

                    <tr colspan="2">
                        <td><center><input type="submit" name="sub1" value="next" > </td>
                        <td><center><input type="submit" name="sub2" value="previous" ' .$disable2.'></td>
                    </tr>
                </form>
            </table>
';
 
 }
 
 ?>


<center><br><br><br>
<form method="post">
<input type="submit" name="sub1" value="start">

</form>
<a href="logout.php">Reset</a>

</div>