How to send variables from javascript to PHP
<p>I want to know how to send variables from javascript to php so i can create a variable that contains dynamic sum of rows.</p>

<p>More specific:
When I search in my search box, i want to get the number of rows (1 match is 1 row, 2 matches is 2 rows and so on</p>

<p>I tried to implement this: document.getElementById("i1").value = allCells.length; so i later could call in the php, but i did not work.</p>

<p>This is my javascript, by the way the javascript works perfectly.</p>

<pre><code>&lt;script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt; 
&lt;script language="javascript" type="text/javascript"&gt;  
  $(document).ready(function() 
  {
    $('#search').keyup(function() {
      searchTable($(this).val());
    });
  });
  function searchTable(inputVal) 
  {
    var table = $('.table');
    table.find('tr').each(function(index, row) 
    {
      var allCells = $(row).find('td');
      if (allCells.length &gt; 0) {
        var found = false;
        allCells.each(function(index, td) 
        {
          var regExp = new RegExp(inputVal, 'i');
          if (regExp.test($(td).text())) 
          {
            found = true;
            return false;
            document.getElementById("i1").value = allCells.length;
          }
        });
        if (found == true)
          $(row).show();
        else
          $(row).hide();
      }
    });
  }

  $(function()
  {
    $('#table a').click(function(e) 
    {
      e.preventDefault();
      $('#result').val($(this).closest('tr').find('td:first').text());
    });
  });
&lt;/script&gt;
</code></pre>

<p>I wanted to spit the dynamicelly sum of rows her in my table header.</p>

<pre><code> &lt;h3&gt;Total: (&lt;?php print_r($_GET["i1"])?&gt;)  &lt;/h3&gt;
</code></pre>

<p>I hope you can help me.</p>
