How do I access webform components labels on the congratulations page Am using the following code in the Congratulations page. There is more but this is the driving force to retrieve user submissions. Its working fine but I need to retreive as well the actual component labels. How do I include the actual questions (labels) on the form. Like if I have a component:

How old are you


10
25


How do I modify the code below to show "How old are you" on the congratulations page?

&lt;?php
include_once(drupal_get_path('module', 'webform') .'/includes/webform.submissions.inc');
$nid = arg(1); 
$sid = $_GET['sid'];
$submission = webform_get_submission($nid, $sid);
    for ($i = 1; $i &lt;= 2; $i++) {
        echo $submission-&gt;data[$i]['value'][0];
    }
?&gt;
The loaded submission doesn't hold the label names so you'll have to get them from elsewhere. One option would be to load the webform node where they can be found. Here's an example about how this would look like in the code:

&lt;?php
include_once(drupal_get_path('module', 'webform') .'/includes/webform.submissions.inc');
$nid = arg(1); 
$sid = $_GET['sid'];
$submission = webform_get_submission($nid, $sid);
$node = node_load($nid);
foreach ($node-&gt;webform['components'] as $key =&gt; $component) {
  if (isset($submission-&gt;data[$key]['value'][0])) {
    if ($component['type'] == 'select') {
      $options = array();
      $items = explode("\n", $component['extra']['items']);
      foreach ($items as $item) {
        $item_parts = explode('|', $item);
        if (isset($item_parts[0]) &amp;&amp; isset($item_parts[1])) $options[$item_parts[0]] = $item_parts[1];
      }
      $no = count($submission-&gt;data[$key]['value']);
      if ($no &gt; 1) {
        $cont = '&lt;p&gt;&lt;strong&gt;'. $component['name'] .':&lt;/strong&gt; ';
        foreach ($submission-&gt;data[$key]['value'] as $k =&gt; $v) {
          if ($k + 1 == $no) $cont .= $options[$v];
          else $cont .= $options[$v] .', ';
        }
        $cont .= '&lt;/p&gt;';
        echo $cont;
      }
      elseif (isset($options[$submission-&gt;data[$key]['value'][0]])) {
        echo '&lt;p&gt;&lt;strong&gt;'. $component['name'] .':&lt;/strong&gt; '. $options[$submission-&gt;data[$key]['value'][0]] .'&lt;/p&gt;';
      }
    }
    else {
      echo '&lt;p&gt;&lt;strong&gt;'. $component['name'] .':&lt;/strong&gt; '. $submission-&gt;data[$key]['value'][0] .'&lt;/p&gt;';
    }
  }
}
?&gt;