title: Store textbox values in php array
body: <p>So basically I have the user enter a number on my first screen.
  Here is test1.php which generates the number of text boxes that the user had previously entered. That number is $input</p>
  
  <pre><code>echo "&lt;form action='test2.php' method='post'&gt;";
  for($i=1; $i&lt;=$input; $i++)
  {
       echo "Entry $i";
       echo "&lt;input type='text' name='Names'&gt;";
  }
  echo "&lt;input type='submit' class='button' name='submit' value='submit'&gt;";
  echo "&lt;/form&gt;";
  </code></pre>
  
  <p>Then my test2.php should print all the values entered, but it only prints out the last value entered from test1.php. For example is $input is 4, only the text entered in the 4th text box prints, which is understandable as I don't know how to print all values.</p>
  
  <pre><code>$names=$_POST['Names'];
  foreach($number as $num){
         echo $num;
  }
  </code></pre>
  
  <p>Is the problem with the name I gave to the textboxes, or something else?
  Any help is much appreciated.</p>