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" "">

  <script type="text/javascript" src=""></script>
    <script type="text/javascript">
			for (i=0;i<=50;i++)
                        var obj = jQuery.parseJSON( response );
                        var success = obj.success;
                        var actionsNumber = obj.number;
                        $("#result").html('There have been  '+actionsNumber+'  loops completed');    

    <form action="" method="post">
    <label><strong>Number of Loops</label>
   <input name="count" type="text" value = "1"/>
    <input id="Submit" type = "button" value = "Send">
    <p id="result">There have been 0 loops completed</p>
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
$_SESSION['number'] = 0;
$number =  $_SESSION['number']++;

// output json response