How to stop adding a number when it reaches its limit
<pre><code>&lt;?php
    session_start();


        if(isset($_POST['sessionNum'])){
            //Declare my counter for the first time

            $_SESSION['initial_count'] = $_POST['sessionNum'];
            $_SESSION['sessionNum'] = $_POST['sessionNum'];

    }

    if(!isset($_SESSION['sessionCount'])){
         $_SESSION['sessionCount'] = 1;
    }
    else
    {
         $_SESSION['sessionCount']++;
    }

$sessionMinus =  $_SESSION['sessionCount'];


?&gt;
</code></pre>

<p>How do I get it so that if <code>$_SESSION['sessionCount']</code> is less than <code>$_SESSION['sessionNum'],</code> then add 1 to <code>$_SESSION['sessionCount']</code> and if it equals <code>$_SESSION['sessionNum']</code>, then stop adding 1 to <code>$_SESSION['sessionCount']</code>?</p>

<p>Also if I go back on a previous page and I go back onto this page, I want <code>$sessionMinus</code> to go back to '1', and finally if the user refreshes the page, then whatever number <code>$sessionMinus</code> is, keep it on that number when page refreshes.</p>
