title: click a link pass a session variable to the next page
body: <p>I have a page where I am using a PHP while loop to echo the names and addresses of our dealers.  For the email link, I want the user to be able to click the link, which would then take him to a form that emails that person.</p>
  
  <p>I know that you can't mix Javascript and PHP, so how do I tell which link the user has clicked on so that I can pass that variable to the form on the next page?  Here is my code:</p>
  
  <pre><code>&lt;?php while($row = mysql_fetch_array($result)) { 
            if ($row['active'] == 1) {
  
  ?&gt;
  
        &lt;div id="dealer"&gt;
  
            &lt;div id="dealername"&gt;
                &lt;h3 style="float:left;"&gt;&lt;?php echo $row['company']; ?&gt;&lt;/h3&gt;&lt;br/&gt;
                &lt;p&gt;&lt;?php echo $row['address1']; ?&gt;&lt;br/&gt;
                   &lt;?php if($row['address2'] || $row['address3']) { 
                          echo $row['address2'] . ' ' . $row['address3'] . '&lt;br/&gt;'; } ?&gt;
                   &lt;?php echo $row['city']; 
                   if ($row['state']) {
                            echo ', ' . $row['state'];
                    }
                    echo '&amp;nbsp;&amp;nbsp;' . $row['zip']; ?&gt;
                    &lt;br /&gt;
                    &lt;?php echo $row['country']; ?&gt;
  
                    &lt;br /&gt;
                    &lt;br /&gt;
                    Phone: &lt;strong&gt;&lt;?php echo $row['phone1']; ?&gt;&lt;/strong&gt;&lt;?php if ($row['phone2']) {
                        echo ' or ' . $row['phone2']; } ?&gt;&lt;br/&gt;
                    &lt;?php if($row['fax']) { echo 'Fax: ' . $row['fax'];  } ?&gt;&lt;br /&gt;
                &lt;/p&gt;
            &lt;/div&gt;
  
            &lt;?php if ($row['email']) {
                echo '&lt;div class="dealerEmail"&gt;'. // need help here . '&lt;/div&gt;';
  
              } ?&gt;
  
          &lt;br class="clearall" /&gt;
          &lt;/div&gt;
  
  
  
  
  &lt;?php }} ?&gt;
  </code></pre>
  
  <p>The page that this code appears on is pulling data from a database using a GET statement based on a URL similar to "index.php?state=az".</p>
  
  <p>I've tried making the email link use a "?email=..." format but when I go to the dealer-email.php page there are no parameters in the URL, which I don't get.  That's why I'm trying to find some other way to pass some kind of variable to the next page, based on which link the user clicks on.</p>
  
  <p>Hope this is clear.  Thanks in advance for your help.</p>