title: Calling PHP function with value from HTML Dropdown Menu
body: <p>I'm in the midst of creating a website that includes shopping cart functionality and have run into an issue with passing variables back-and-forth from HTML/Javascript to PHP.  I understand that these languages are fundamentally different and was hoping someone could provide some guidance.  I've seen several questions on similar topics, but unfortunately have yet to find a solution that works for my situation. </p>
  
  <p>I have created a multidimensional array of products in php and would like to capture the value from a dropdown menu to call a function in which the value of the dropdown corresponds to a row in the product array.  My list of products appear in a HTML table.  I have experimented with $_GET and $_POST, but haven't had any luck.  Plus I would like to avoid adding a submit button as the print_wp_cart_button_for_product function outputs an add to cart button.  The print_wp_cart_button_for_product also creates the shopping cart on the sidebar.</p>
  
  <pre><code>&lt;TD&gt;
    &lt;form action="&lt;?php echo $_SERVER['PHP_SELF'];?&gt;" method="get"&gt;
    &lt;select id="productcat1" name="productcat1"&gt;
      &lt;option value="$"&gt;--Please Select--&lt;/option&gt;
      &lt;option value="1"&gt;Product # 1 - $1.99&lt;/option&gt;
      &lt;option value="2"&gt;Product # 2 - $1.99&lt;/option&gt;
      &lt;option value="3"&gt;Product # 3 - $9.99&lt;/option&gt;
      &lt;option value="4"&gt;Product # 4 - $9.99&lt;/option&gt;
    &lt;/select&gt;
    &lt;/form&gt;
  &lt;/TD&gt;
  &lt;TD&gt;    
    &lt;?php $currentrow = 0; ?&gt;
    &lt;?php $currentrow = $_GET["productcat1"]; ?&gt;
    &lt;?php echo print_wp_cart_button_for_product($products[$currentrow]["Product"], $products[$currentrow]["Price"]); ?&gt;
  &lt;/TD&gt;       
  </code></pre>