I'm using SESSION to get data from another page, the problem is it will only show the last result on the new page (page 2) instead of showing all of the results from the previous page (page 1).
My code on the first page (page 1) is:
<?php session_start();?>
<?php
if(isset($POST['interest'])) {
foreach($POST['interest'] as $value){
echo "<p>{$value}</p>";
$_SESSION['Result']=$value;
}
}
?>
The code on the new page (page 2) is:
<?php session_start();?>
<?php
$test = $_SESSION['Result'];
$sometxt = 'text will appear here';
$fname = 'presurveydoc.doc';
header("Content-type: application/msword");
header("Content-disposition: attachment; filename=\"$fname\"");
header("Content-length: " . strlen($test));
header("Content-transfer-encoding: ascii");
header("Pragma: no-cache");
header("Expires: 0");
echo $test;
die();
?>
Any ideas of the loop I need or where it will go in the code on the second page pleaseeeeeeeee? :o