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?
<?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 <= 2; $i++) {
echo $submission->data[$i]['value'][0];
}
?>