title: Foreach loop only looping once?
body: <p>I'm having trouble with my foreach loop opening multiple files. </p>
  
  <p>My foreach loop is only running once for the first item number. The foreach loop runs then goes to the "api.php" page but then stops and doesn't go back to the foreach loop to get the next item number. How do I tell it to go through all of item numbers in my database?</p>
  
  <p>Would I use cURL somehow?</p>
  
  <p>Thanks</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$itemnumber = array("".$result['item_number']."");
  
  foreach ($itemnumber as $item_number) {
  
  echo "&lt;form method=\"post\" action=\"api.php\" name=\"ChangeSubmit\" id=\"ChangeSubmit\"&gt;";
  echo "&lt;input type=\"text\" name=\"item_number\" value=\"{$item_number}\" /&gt;";
  
  echo "&lt;script type=\"text/javascript\"&gt;
  function myfunc () {
  var frm = document.getElementById(\"ChangeSubmit\");
  frm.submit();
  }
  window.onload = myfunc;
  &lt;/script&gt;&lt;/form&gt;";
  
  
  
  }
  </code></pre>