title: Sending user data over part 2
body: <p>I am seeking some more advice on the way to handle this.</p>
  
  <p>I have got one page with links to each admin member which when clicked takes their display name over. On the second page which is a form it takes that display names and populates the subject field with their display name. I need to grab the email address that is associated to that user too but use that as the email address the form on the second page gets sent to as currently my script can only send it to an email address I hard code into it.</p>
  
  <p>So page one is:</p>
  
  <pre><code>&lt;?php
  $args1 = array(
   'role' =&gt; 'committee',
   'orderby' =&gt; 'user_nicename',
   'order' =&gt; 'ASC'
  );
   $committee = get_users($args1);
  
  
  foreach ($committee as $user) {
  echo ' 
  
      &lt;a href="../contact-form?displayname=' . $user-&gt;display_name . '"&gt;&lt;b style="font-size:18px;"&gt;
      &lt;tr&gt;
          &lt;td style="padding: 10px;"&gt;' .$user-&gt;job_title .' - &lt;/td&gt;
          &lt;td style="padding: 10px;"&gt;' .$user-&gt;display_name .'&lt;/td&gt;
      &lt;/tr&gt;&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;';
  
   }
  
  ?&gt;
  </code></pre>
  
  <p>Page two is:</p>
  
  <pre><code>&lt;?php $displayname = $_GET['displayname'];?&gt;
  
  &lt;form role="form" method="post" action="../mailuser.php"&gt;  
  
  &lt;div class="form-group"&gt;
  
  &lt;input type="hidden" name="displayname" value="&lt;?php echo $displayname ?&gt;"&gt;
  &lt;input type="text" name="hp" class="hp" value="" alt="if you fill this field out then your email will not be sent"&gt;
  
  &lt;/div&gt;
  
  
  &lt;div class="form-group"&gt;
  &lt;label for="InputName"&gt;Your name&lt;/label&gt;
  &lt;input type="name" class="form-control" id="InputName" placeholder="Enter your name" name="username"&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;                      
  &lt;label for="InputEmail"&gt;Email address&lt;/label&gt;
  &lt;input type="email" class="form-control" id="InputEmail" placeholder="you@example.com" name="emailFrom"&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;                             
  &lt;label for="InputMsg"&gt;Message&lt;/label&gt;
  &lt;textarea class="form-control" rows="8" id="InputMsg" placeholder="Please begin typing your message..." name="emailMessage"&gt;&lt;/textarea&gt;   
  &lt;/div&gt;    
  
  &lt;button type="submit" class="btn btn-primary pull-right"&gt;Send&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And my send script has my email hard coded in as:</p>
  
  <p>$mail->From = 'myemail@dummy.com';</p>
  
  <p>So I need that be variable depending on which person you clicked on in the first place. It needs to be sent to both my hard coded email and also the persons email that is associated to them in the Wordpress user database.</p>