Catch a dynamic variable by using POST
<p>I write two file <code>main.php</code> and <code>download.php</code>.</p>

<p><strong>main.php</strong></p>

<pre><code>echo"&lt;form action='download.php' method='post'&gt;"
for(i = 0; i &lt; 10; i++){
    echo"&lt;input type='submit' name='$i'&gt;";
}
</code></pre>

<p>In <code>download.php</code>, I want to know which name's button is pressed? (from 1 to 10 to download the file), so that I can use it in download.php to download file.</p>

<p>I have tried to use $_POST["$i"] but failed.</p>

<p>What if the $i is a random filename?</p>

<p>Thx!   </p>

<p>complete code</p>

<p>main.php:http://codepad.org/4zXPhqFy</p>
