title: make function to create auto input box
body: <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;ssc prepartion&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;&lt;form action="ssc.php" method="post"&gt;
      1
      &lt;input name="name" type="text"&gt;
      &lt;input name="submit" type="submit"value="result"&gt;&lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  
  
  <pre><code>// creating php file to get the result.
  &lt;?php
     $name=$_REQUEST["name"];
  
     $text="user".$name;
     echo'&lt;form action="ssc1.php" method="post"&gt;';
     for($x =0; $x &lt;= $name; $x++) {
      echo '&lt;label for="'. $name .'"&gt;'.$x.'&lt;/label&gt;';
        echo '&lt;input type="text" name="'.$text.'" &gt;&lt;br&gt;&lt;br&gt;';
     }
  
     echo'&lt;input type="submit" value="result"&gt;';
     echo'&lt;/form&gt;';
  ?&gt;
  </code></pre>
  
  <p>So here I am trying to create input fields by making a small PHP function. It's working and creates input fields but the problem is after creating these input fields.</p>
  
  <p>I can't figure out how to give a name or id to these input fields and how to get the values from all the fields created.</p>
  
  <p>My question is how could we receive the values from these input fields after creating these all?</p>