title: Trying to fill fields with Javascript, echoed by PHP
body: <p>Here's my code. Is there some reason this should not work? I'm getting all of the fields from MySQL.</p>
  
  <p>Basically what I want is to send information back from a page, with an id number, and this should be used to select the row number for MySQL.</p>
  
  <p>Here's my code from the first page:</p>
  
  <pre><code>$org = $_POST['organization'];
  header('Location: '.$admin.'?org='.$org);
  </code></pre>
  
  <p>And then my code on main page:</p>
  
  <pre><code>ECHO '&lt;script&gt;';
  ECHO 'document.getElementById("orgid").value="'.$org_id.'"';
  ECHO 'document.getElementById("orgname").value="'.$org_name.'"';
  ECHO 'document.getElementById("add1").value="'.$add_1.'"';
  ECHO 'document.getElementById("add2").value="'.$add_2.'"';
  ECHO 'document.getElementById("city").value="'.$city.'"';
  ECHO 'document.getElementById("state").value="'.$state.'"';
  ECHO 'document.getElementById("zip").value="'.$zip.'"';
  ECHO 'document.getElementById("url").value="'.$url.'"';
  ECHO 'document.getElementById("email").value="'.$email.'"';
  ECHO 'document.getElementById("phone").value="'.$phone.'"';
  ECHO 'document.getElementById("contact").value="'.$contact.'"';
  ECHO 'document.getElementById("hours").value="'.$hours.'"';
  ECHO 'document.getElementById("file").value="'.$file.'"';
  ECHO 'document.getElementById("notes").value="'.$notes.'"';
  ECHO 'document.getElementById("description").value="'.$description.'"';
  ECHO '&lt;/script&gt;';
  </code></pre>
  
  <p>And here's the code to communicate with MySQL:</p>
  
  <pre><code>if (isset($_GET["org"])  &amp;&amp; ($_GET['org'] !== '')) {
  $org = $_GET['org'];
  $resorgfull = mysql_query("SELECT org_id, org_name, add_1, add_2, city, state, zip, url, email, phone, contact, hours, file_loc, notes, description FROM organization WHERE org_id=".$org.");
  if (!$resorgfull) {
      die('Invalid query: ' . mysql_error());
  }
  </code></pre>