so i have this code i am working on(this is a dumbed down version of it)
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html> 
    <head>
    

  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#Submit").click(function(){
			for (i=0;i<=50;i++)
			{
                $.ajax({
                    url:"process.php",
                    type:"get",
                    data:$("form").serialize(),
                    success:function(response){
                        var obj = jQuery.parseJSON( response );
                        var success = obj.success;
                        var actionsNumber = obj.number;
                        $("#result").html('There have been  '+actionsNumber+'  loops completed');    
				

                    }
                })
            }
			
			})
        })
    </script>
    </head>
  <body>
    <form action="" method="post">
    <p>
    <label><strong>Number of Loops</label>
    </p>
   <input name="count" type="text" value = "1"/>
    </p>
    
    <p>
    <input id="Submit" type = "button" value = "Send">
    </p>
    <p id="result">There have been 0 loops completed</p>
    </body></html>
so you see this for loop

for (i=0;i<=50;i++)

I want it to be able to be like

for (i=0;i<=count;i++)

so that it will loop the number of times inputted

but on my full script of my site there are other values that are inputted that need to be sent to process.php(i will post this at the end, all that it does in this example is essentially add one to a variable and echo it)

How can i achieve this?


and here is the process.php

PHP Code:
<?php session_start();
// process the form data here
//:::::::::
//
if(!isset($_SESSION['number'])){
      
$_SESSION['number'] = 0;
    }
$number =  $_SESSION['number']++;

// output json response 
echo'{"success":"true","number":"'.$number.'"}';
?>