title: Pass value from dynamically generated table
body: <p>I am new to php.
  I have created a code that generates table of products dynamically.
  I want to submit particular product to add that product in cart and Product_id should be pass to next page.
  I am using form for that. However, the problem is I dont know how to pass value to other page.</p>
  
  <h1>here is my code</h1>
  
  <pre><code>while ($rows = mysql_fetch_array($sql_result,MYSQL_ASSOC)) 
              { 
                  $name=$rows['Product_Name'];
                  $price=$rows['Price'];
                  $srtdesc=$rows['Short_Descr'];
                  $dtdescr=$rows['Dtl_Descr'];
                  $pid=$rows['Product_ID'];
                echo "&lt;TD align='center'&gt;". $name ."&lt;br /&gt;"."$price". "&lt;/br&gt;"."$srtdesc"."&lt;/br&gt;"."$pid"."&lt;br/&gt;"."&lt;img height=100% width=100% src=images/Products/"."$pid.jpg /&gt;"."&lt;input type='submit'/&gt;"."&lt;/TD&gt;\n"; 
  
                if ($columnCounter % 4 == 0) {                 
                      echo "&lt;/TR&gt;\n &lt;TR&gt;\n"; 
                  }
                  $columnCounter = $columnCounter + 1;
              } 
              echo "&lt;/TR&gt;\n"; 
            } else { 
              echo "&lt;TR&gt;\n&lt;TD colspan='" . ($i+1) . "'&gt;No Results found!&lt;/TD&gt;&lt;/TR&gt;\n"; 
          } 
          echo "&lt;/TBODY&gt;\n&lt;/TABLE&gt;\n";
          echo "&lt;/DIV&gt;\n";
          echo "&lt;/form&gt;";
  </code></pre>