title: Multiple window.open using JavaScript in php
body: <p>I am trying to open multiple new windows(browser tabs) from php using javascript but don't know why it will open only one window always, and also don't found any solution of this. Here is my code.</p>
  
  <pre><code>&lt;?php
  
  openWindow("name1","id1");
  openWindow("name2","id2");
  
  function openWindow($name,$id)
  {
  echo "name = $name and Id = $id";
  
  echo "
  
  &lt;form id=$name method='post' action='studentDetails.php' target='TheWindow'&gt;
  &lt;input type='hidden' name='name' value=$name /&gt;
  &lt;input type='hidden' name='id' value=$id /&gt;
  &lt;/form&gt;
  
  &lt;script type='text/javascript'&gt;
  window.open('', 'TheWindow');
  document.getElementById(&lt;?php echo $name;?&gt;).submit();
  &lt;/script&gt;
  
  ";
  }
  ?&gt;
  </code></pre>