title: I have a short html form with a php for loop which allows the user to build the same form up to ten times on the page
body: <p>The $i variable is each field and is populated in the 'inp' boxes which are just input boxes and sboxes which are just select boxes. There is only one form when the page loads and it has all the criteria for a trainer to be added. The trainer name would be trainer_name1 on the first form. If they chose to hit the new button they could fill out the information for another trainer, the input box for the second form for 'name' would just be trainer_name2 and all the other fields are named respectively to what they are in the form. As new forms are built in just adds the next consecutive number onto the end of whatever the field might be named.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;fieldset&gt;&lt;legend&gt;Trainer Request&lt;/legend&gt;&lt;/fieldset&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type='button' onClick="if (show_item(1,10, 0)) { this.style.display = 'none'; }" value='New'&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;?php
  $contact_array = array('ACCEPTED TRAINING','DECLINED TRAINING','LEFT MESSAGE FOR TRAINING ACCEPTANCE',
          'NEED TO CONTACT TO SEE IF INTERESTED',
          'NEED PAPERWORK/TRAINING',
          'NEED SIGNED CONTRACT AND PAPERWORK',
          'NEED TO COMPLETE TRAINING');
  
  for ($i = 10; $i &gt; 0; $i=$i-1)
      {
      echo "&lt;table id='hidden$i' style='display:none;'&gt;&lt;tr&gt;";
      echo "&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;Status&lt;/td&gt;&lt;/tr&gt;";  
      echo "&lt;tr&gt;&lt;td&gt;"; inp("date$i"); echo "&lt;/td&gt;&lt;td&gt;";
      sbox("contact$i", $contact_array, 0, 'wide2');
      echo "&lt;/td&gt;&lt;/tr&gt;
  
      &lt;tr&gt;&lt;td&gt;Facility&lt;/td&gt;&lt;td&gt;"; 
      inp("facility$i",50);   echo "&lt;/td&gt;&lt;/tr&gt;";
      echo "&lt;tr&gt;&lt;td&gt;Trainer Name&lt;/td&gt;&lt;td&gt;";
      inp("trainer_name$i",35);
      echo "&lt;tr&gt;&lt;td&gt;Distance From&lt;/td&gt;&lt;td&gt;";
      sbox("distance_from$i", array('1','2','5','10','15','20','25','30','40','50','60','70','80','90','100'));
      echo "&lt;/td&gt;&lt;/tr&gt;
  
      &lt;tr&gt;&lt;td&gt;Phone&lt;/td&gt;&lt;td&gt;";
      inp("phone$i",13,'phone');
      echo "&lt;/td&gt;&lt;tr&gt;&lt;tr&gt;&lt;td&gt;Email&lt;/td&gt;&lt;td&gt;";
      inp("email$i",50);
      echo "&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Address 1&lt;/td&gt;&lt;td&gt;";
      inp("addr1$i",50);
      echo "&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Address 2&lt;/td&gt;&lt;td&gt;";
      inp("addr2$i",10);
      echo " City ";
      inp("city$i",20);
      echo "&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;State&lt;/td&gt;&lt;td&gt;";
      inp("state$i",2);
          echo " Zip ";
      inp("zip$i",'zip');
      echo "&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Notes&lt;/td&gt;&lt;td&gt;";
      tbox("notes$i", 40, 3);
      echo "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
      }
  ?&gt;
  
  &lt;script type='text/javascript'&gt;
  show_item(1,10,1);
  &lt;/script&gt;
  </code></pre>
  
  <p>As you can see down here I'm building a link which would name the link whatever the trainer name is, in this case trainer_name1 is Tim Jackson, so i've just built a hyperlink with his name.</p>
  
  <pre><code>&lt;?php
  // print_r ($_GET);
  
      echo sendback_link($_GET['trainer_name1'], 'ACS/TrainerLookup', 'trainer_id=trainer_code&amp;trainer_name=trainer_name'); 
  
  
  ?&gt;
  </code></pre>
  
  <p>I'm confused on how to add a dynamic link like this into the for loop so as the form builds 1 - 10 each trainer_name2, trainer_name3, trainer_name4 etc etc. will have their names hyperlinked. </p>
  
  <p>I'm thinking I create a new variable for the number 1-10 and append it onto the $_GET[trainer_name$].. something like that?</p>
  
  <p>I hope that makes sense and any help would be greatly appreciated.</p>