assuming that 'field_id1' is the data stored in 'form_1' and the one that I would like to display just as text instead of form field.But this does not work... Obviously there is some mistake in the code..Any help is appreciated😉Brgds,Raivis"> display session data [SOLVED] - Forums

Forums

display session data [SOLVED]

raivis 13 Aug, 2012
Hi Guys!

I have 'form_1' which OnSubmit action stores data in DB and also stores data in session called "sesskey".
Then there is redirect action to another form page 'form_2' (different form with different form name).
I use the session "sesskey" to pass the data from 'form_1' to 'form_2'.

I can pass data from 'form_1' fields to respective form fields to 'form_2' easy, but I am looking how to display these data as "pure html text" instead of form field.

I guess it can be done by Custom Code something like:
<?php
foreach($form->data['sesskey'] as $detail){
echo $detail['field_id1'];
echo '<br />';
echo $detail['field_id2'];
echo '<br />';
echo $detail['field_id3'];
echo '<br />';
}
?>

assuming that 'field_id1' is the data stored in 'form_1' and the one that I would like to display just as text instead of form field.

But this does not work... Obviously there is some mistake in the code..
Any help is appreciated😉

Brgds,
Raivis
raivis 13 Aug, 2012
And error reporting shows:
Notice: Undefined index: sesskey
Warning: Invalid argument supplied for foreach()
raivis 13 Aug, 2012
Got it work!

Correct code is:
<?php
foreach($form->data as $key => $value) {
  echo $form->data['field_id1'];
  echo '<br />';
  echo $form->data['field_id2'];
  echo '<br />';
}
?>
There was no need to specify Session Id (in my case "sesskey") in the code.

Brgds,
Raivis
This topic is locked and no more replies can be posted.