chrome and firefox have different page numbers displayed
<p>I have this line of code below where it states to the user which page they are currently on out of the total number of pages:</p>

<pre><code>&lt;h1&gt;&lt;?php echo $sessionMinus ?&gt; OF &lt;?php echo $_SESSION['initial_count'] ?&gt;&lt;/h1&gt;
</code></pre>

<p>The above code could read like this: <code>1 OF 7</code>, <code>3 OF 5</code>, <code>5 OF 6</code> and etc. </p>

<p>But there is a problem and I am currently having between google chrome and mozilla firefox. Below I have a link to the application <a href="http://helios.hud.ac.uk/u0867587/Mobile_app/Text4.php" rel="nofollow">here</a>. Can you open up the application in both Firefox and chrome and follow the steps below and you will be able to see the problem:</p>

<ol>
<li><p>Open up the URL I have provided in both chrome and firefox</p></li>
<li><p>On both pages please enter in a number of Sessions (type in      7) and then submit the page on both browsers.</p></li>
<li><p>You will see on    the top of both browsers there is a    heading:
<code>"CREATING QUESTIONS AND    ANSWERS: SESSION 1 OF 7"</code>.</p></li>
<li><p>On the page in both browsers,    click on the "Add Question"
button 3 times so that it adds 3 rows,    each row
    containing a image    file input. </p></li>
<li>Now click on the    "Submit Details" button at bottom of page    for
both browsers.</li>
</ol>

<p>What I want you to do is to now see what the heading <code>"CREATING QUESTIONS AND ANSWERS: SESSION ... OF 7"</code>. now says. In firefox it works perfectly as that you have completed the first page so you are now in the second page so that is why it states <code>"CREATING QUESTIONS AND ANSWERS: SESSION 2 OF 7"</code>. </p>

<p>But in chrome it doesn't work well. In chrome instead it states <code>"CREATING QUESTIONS AND ANSWERS: SESSION 5 OF 7"</code>. This is because is chrome it is adding a number for each row that has been added (as that to add a row, the form uploads to its self page). So after submitting first page, new page would add a number to make it <code>2 OF 7</code> but then 3 rows added in first page makes it <code>5 OF 7</code> in chrome which is completely incorrect.</p>

<p>So my question is why is it working differently in chrome than in firefox and is there a way I can get chrome working the same way as firefox so that the correct page numbers are displayed everytime the user goes onto the next page?</p>

<p>Below is the full code:</p>

<pre><code>&lt;?php

    session_start();


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

                $_SESSION['initial_count'] = $_POST['sessionNum'];
                $_SESSION['sessionNum'] = intval($_POST['sessionNum']);
                $_SESSION['sessionCount'] = 1;

        }

    else if ($_SESSION['sessionCount'] &lt; $_SESSION['sessionNum']) {
        $_SESSION['sessionCount']++;
    }


    $sessionMinus =  $_SESSION['sessionCount'];

    if ($sessionMinus == $_SESSION['initial_count']){ 

        $action = 'create_session2.php'; 

    }else if($sessionMinus != $_SESSION['initial_count']){ 

        $action = $_SERVER['PHP_SELF']; 

    }

    ?&gt;

    &lt;script type="text/javascript"&gt;


    function insertQuestion(form) {   


        var $tbody = $('#qandatbl &gt; tbody'); 
        var $tr = $("&lt;tr class='optionAndAnswer' align='center'&gt;");
        var $image = $("&lt;td class='image'&gt;&lt;/td&gt;"); 


    var $fileImage = $("&lt;form action='imageupload.php' method='post' enctype='multipart/form-data' target='upload_target' onsubmit='return imageClickHandler(this);' class='imageuploadform' &gt;" + 
        "&lt;p class='imagef1_upload_process' align='center'&gt;Loading...&lt;br/&gt;&lt;img src='Images/loader.gif' /&gt;&lt;br/&gt;&lt;/p&gt;&lt;p class='imagef1_upload_form' align='center'&gt;&lt;br/&gt;&lt;label&gt;" + 
        "Image File: &lt;input name='fileImage' type='file' class='fileImage' /&gt;&lt;/label&gt;&lt;br/&gt;&lt;br/&gt;&lt;label class='imagelbl'&gt;" + 
        "&lt;input type='submit' name='submitImageBtn' class='sbtnimage' value='Upload' /&gt;&lt;/label&gt;" + 
        "&lt;iframe class='upload_target' name='upload_target' src='#' style='width:0;height:0;border:0px;solid;#fff;'&gt;&lt;/iframe&gt;&lt;/form&gt;");     

        $image.append($fileImage);


        $tr.append($image);  
        $tbody.append($tr); 



    }


                 function showConfirm(){

             var confirmMsg=confirm("Make sure that your details are correct, once you proceed after this stage you would not be able to go back and change any details towards Questions, Options and Answers for your Session." + "\n" + "\n" + "Are you sure you want to Proceed?" + "\n" );

             if (confirmMsg==true)
             {
             submitform();   
         }
    }

             function submitform()
    {
        var fieldvalue = $("#QandA").val();
        $.post("insertQuestion.php", $("#QandA").serialize() ,function(data){
            var QandAO = document.getElementById("QandA");
            QandAO.submit();
        });  
        alert("Your Details for this Session has been submitted"); 
    }




    &lt;/script&gt;

    &lt;/head&gt;

    &lt;body&gt;

    &lt;form id="QandA" action="&lt;?php echo htmlentities($action); ?&gt;" method="post"&gt;

    &lt;h1&gt;CREATING QUESTIONS AND ANSWERS: SESSION &lt;?php echo $sessionMinus ?&gt; OF &lt;?php echo $_SESSION['initial_count'] ?&gt;&lt;/h1&gt;

    &lt;div id="detailsBlock"&gt;

    &lt;table id="questionBtn" align="center"&gt;
    &lt;tr&gt;
    &lt;th&gt;
    &lt;input id="addQuestionBtn" name="addQuestion" type="button" value="Add Question" onClick="insertQuestion(this.form)" /&gt;
    &lt;/th&gt;
    &lt;/tr&gt;
    &lt;/table&gt;

    &lt;/div&gt;
    &lt;hr/&gt;

    &lt;div id="details"&gt;
    &lt;table id="qandatbl" align="center"&gt;
    &lt;thead&gt;
    &lt;tr&gt;
        &lt;th class="image"&gt;Image&lt;/th&gt;
    &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;/div&gt;

    &lt;p&gt;&lt;input id="submitBtn" name="submitDetails" type="submit" value="Submit Details" onClick="myClickHandler(); return false;" /&gt;&lt;/p&gt;

    &lt;/form&gt;

             &lt;script type="text/javascript"&gt;

    function myClickHandler(){
         if(validation()){
                    showConfirm();
         }
    }

    &lt;/script&gt;



    &lt;/body&gt;
    &lt;/html&gt;
</code></pre>
