Page 1 of 1

PHP Survey-displaying results on final page

Posted: Mon Oct 31, 2005 9:14 pm
by jagweb
Hi,

I am using the phpsurveyor script and am trying to display the results of the survey before the person submits it. The page would allow the person to review their entries.


I know it can be done because it is displayed in the confirmation email sent to the administrator when someone submits a survey.

Here is the code that displays the results of the survey in the email

Code: Select all

if ($sendnotification > 1)
		{ //Send results as well. Currently just bare-bones - will be extended in later release
		$message .= "----------------------------\r\n";
		foreach ($_SESSION['insertarray'] as $value)
			{
			$questiontitle=returnquestiontitlefromfieldcode($value);
			$message .= "$questiontitle:   ";
			if (isset($_SESSION[$value]))
				{
			    $message .= getextendedanswer($value, $_SESSION[$value]);
				}
			$message .= "\r\n";
			}
		$message .= "----------------------------\r\n\r\n";
		}


If you need to see the rest of the code I can add it

How do I add the results of the survey into a regular .php page?


Thanks I am an html person and am do not use php often.

Posted: Mon Oct 31, 2005 9:34 pm
by feyd
copy out the foreach loop...

Posted: Mon Oct 31, 2005 10:59 pm
by jagweb
On the page I want to display it on, all other info is displayed as such

Code: Select all

<center>
<br />
{SUBMITCOMPLETE}<br /><br />

{SUBMITRESULTS}<br/><br/>
{SUBMITBUTTON}<br /><br />

{SUBMITREVIEW}<br /><br />

{PRIVACY}
<br />
</center>

How would insert the foreach statement so it is displayed as {SUBMITRESULTS}. Basically how do I define the foreach?


Sorry I am new to php and have read the tutorials, but they haven't answered my question.