pass variable through hidden input php
<p>I am anew to php please help...
I am trying to collect a variable (in specific the counter I used in my loop) on a $_POST after I submit my form.</p>

<pre><code>&lt;form action="reportingTemplate.php" method="post"&gt;
&lt;?php
    function buildform() {
    if (file_exists('textt.txt')){

            $x = file_get_contents('textt.txt');
            $y = explode("\r\n", $x);

                $incr = 1;
            foreach ($y as $value) {
            $z = explode(",", $value);

            writehtml($incr,$z[1],$z[2],$z[0]);

      $incr++;
            }   
            if ($incr &lt; 15)
                for ($incr = $incr; $incr&lt;16; $incr++) {
                    writehtml($incr,"","","");

                }
        }
        else
        for ($increm = 1; $increm&lt;16; $increm++) {
            writehtml($increm,"","","");
        }
    }
    ?&gt;
    &lt;input type="hidden" id="test" name"countt" value="&lt;?php echo $incr; ?&gt;"/&gt; &lt;!--error area --&gt;
    &lt;input type="submit"/&gt;
    &lt;/form&gt;
</code></pre>

<p>where I am getting my $_POST:</p>

<pre><code>$the = $_POST["countt"];
echo $the;
</code></pre>
