title: i need to echo a dropdown selection which is populated from mysql on another page
body: <p>I have a three drop downs, 2 of which are populated from Mysql, so depending on what is selected in the first, define's what populates in the second, and then third. however. i need to take the users 3 selections, and carry them onto the next page and echo them, and then the same for the third page, i need to take the first pages answers, and the second, and echo them on the third page. and so on. this is my code so far:</p>
  
  <pre><code>&lt;?php
  ``if (@$_REQUEST['ajax']) {
  // connect to local database 'test' on localhost
  $link = mysql_connect('localhost', 'user', 'pass');
  if ($link == false)
      trigger_error('Connect failed - ' . mysql_error(), E_USER_ERROR);
  
  $connected = mysql_select_db('test', $link);
  
  if ($connected) {
      $results = mysql_query('select * from test.select_chain where category="' . strtolower(mysql_real_escape_string(strip_tags($_REQUEST['category']))) . '"');
  
      $json = array();
  
      while (is_resource($results) &amp;&amp; $row = mysql_fetch_object($results)) {
          //$json[] = '{"id" : "' . $row-&gt;id . '", "label" : "' . $row-&gt;label . '"}';
          $json[] = '"' . $row-&gt;label . '"';
      }
  
      echo '[' . implode(',', $json) . ']';
      die(); // filthy exit, but does fine for our example.
  } else {
      user_error("Failed to select the database");
      }
  }
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Select Chain&lt;/title&gt;
  &lt;style type="text/css" media="screen"&gt;
  &lt;!--
    BODY { margin: 10px; padding: 0; font: 1em "Trebuchet MS", verdana, arial, sans-serif; }
    BODY { font-size: 100%; }
    H1 { margin-bottom: 2px; font-family: Garamond, "Times New Roman", Times, Serif;}
    DIV.selHolder { float: left; border: 3px solid #ccc; margin: 10px; padding: 5px;}
    TEXTAREA { width: 80%;}
    FIELDSET { border: 1px solid #ccc; padding: 1em; margin: 0; }
    LEGEND { color: #ccc; font-size: 120%; }
    INPUT, TEXTAREA { font-family: Arial, verdana; font-size: 125%; padding: 7px; border: 1px solid #999; }
    LABEL { display: block; margin-top: 10px; } 
    IMG { margin: 5px; }
    SELECT { margin: 10px; width: 200px; }
  --&gt;
  &lt;/style&gt;
  
  &lt;script src="jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="select-chain.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  &lt;!--
  $(function () {
      var cat = $('#categorySelect');
      var el = $('#elementSelect');
      var attr = $('#attributeSelect');
  
      el.selectChain({
          target: attr,
          url: 'index.php',
          data: { ajax: true, anotherval: "anotherAction" }            
      });        
  
      // note that we're assigning in reverse order
      // to allow the chaining change trigger to work
      cat.selectChain({
          target: el,
          url: 'index.php',
          data: { ajax: true }
      }).trigger('change');
  
  });
  //--&gt;
     &lt;/script&gt;
    &lt;/head&gt;
      &lt;center&gt;&lt;img src="tgd.png" alt="The Global Dollar" href="index.php"&gt;&lt;/center&gt;
     &lt;body id="page"&gt;
      &lt;div id="doc"&gt;
      &lt;center&gt;&lt;h1&gt;Country&lt;/h1&gt;&lt;/center&gt;
      &lt;div class="selHolder"&gt;
          &lt;h2&gt;Continent&lt;/h2&gt;
          &lt;select id="categorySelect" name="category" size="5"&gt;
            &lt;option&gt;Africa&lt;/option&gt;
        &lt;option&gt;America&lt;/option&gt;
    &lt;option&gt;Antarctica&lt;/option&gt;
    &lt;option&gt;Asia&lt;/option&gt;
    &lt;option&gt;Australia&lt;/option&gt;
    &lt;option&gt;Europe&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="selHolder"&gt;
          &lt;h2&gt;Country&lt;/h2&gt;
          &lt;select id="elementSelect" name="category" size="5"&gt;
              &lt;option&gt;[none selected]&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="selHolder"&gt;
          &lt;h2&gt;City&lt;/h2&gt;
          &lt;select id="attributeSelect" name="category" size="5"&gt;
              &lt;option&gt;[none selected]&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;/div&gt;
     &lt;a href="../secondpage"&gt;Next Page &lt;/a&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Anyone know how i can do this? sorry if i have been unclear, its hard to describe. 
  thanks in advance</p>