title: How to pass in an 'id' when clicking on a 'View Full Profile' link
body: <p>I am working on some functionality where having performed an initial search, a subset of profile details are being displayed.  This works fine.</p>
  
  <p>There is then a link called 'View Full Profile' which if clicked should return the entire profile.</p>
  
  <p>I have got this working with a hardcoded id, but am not sure how to pass in the id of the profile from the subset of information?</p>
  
  <p>I don't actually know if that value (the id of the profile) is currently available for me to acccess so that I can pass it in if that makes sense?</p>
  
  <p>In the subset of profile details I have included a hidden field which does contain the id I would like to pass in but I'm not sure if this can be used?</p>
  
  <p>The relevant code is posted below.</p>
  
  <p>SUBSET-PROFILE.HTML.PHP</p>
  
  <pre><code>    &lt;div id="Profile" class="Profile"  &gt;
  
      &lt;h1 class="margin-top"&gt;Search Results&lt;/h1&gt;
  
      &lt;?php if (isset($results)): ?&gt;
  
      &lt;?php foreach ($results as $result): ?&gt;
  
      &lt;ol class="coach-display"&gt;
      &lt;li class="left image"&gt;
        &lt;img src="&lt;?php if (!empty($result['filename'])) echo('?action=view&amp;id=' . $result['id']); else echo "/img/profile_coming_soon.jpg" ?&gt;" width="80" height="80" /&gt;
        &lt;/li&gt;
      &lt;li class="listleft"&gt;First Name:&lt;/li&gt;
      &lt;li&gt;&lt;?php htmlout($result['firstname']); ?&gt;&lt;/li&gt;
  
      &lt;li class="listleft"&gt;Last Name:&lt;/li&gt;
      &lt;li&gt;&lt;?php htmlout($result['lastname']); ?&gt;&lt;/li&gt;
  
      &lt;li class="listleft"&gt;Constituency:&lt;/li&gt;
      &lt;li&gt;&lt;?php htmlout($result['constituency']); ?&gt;&lt;/li&gt;
  
      &lt;li class="listleft"&gt;Qualifications:&lt;/li&gt;
      &lt;li&gt;&lt;?php htmlout($result['qualifications']); ?&gt;&lt;/li&gt;
  
      &lt;/ol&gt;
  
      &lt;input type="hidden" name="id" value="&lt;?php htmlout($result['id']); ?&gt;"&gt;
  
      &lt;a href="?more"&gt;View full profile&lt;/a&gt;
  
      &lt;?php endforeach; ?&gt;
  
      &lt;?php endif; ?&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>INDEX.PHP</p>
  
  <pre><code>    if (isset($_GET['more']))
      {
          try
          {
  
          $sql = "SELECT id, firstname, lastname, area, county, constituency, qualifications, bio, monday, tuesday, wednesday, thursday, friday, saturday, sunday,
                  filename, mimetype
                  FROM pt
                  WHERE id = 6";
          $s = $pdo-&gt;query($sql);
          }
          catch (PDOException $e)
          {
              $error = 'Error fetching pt details.' . $e-&gt;getMessage();;
              include 'profiles.html.php';
              exit();
          }
  </code></pre>
  
  <p>You can see in INDEX.PHP where I have hard coded the value to 6.  This is the value that I need to be dynamic dependent on which profile subset was previously being viewed.</p>
  
  <p>Thanks for your time and help on this.</p>