Thanks for your reply -- I'm trying to do this as you recommended (using an RTF template) but having some difficulty.
I have created a RTF template that has fields such as:
<<FIELD1>> and <<FIELD2>>
in the places that I need to get my data inserted after it is passed from a form. It almost works -- the RTF file gets saved to my desktop. But then the items that I want replaced are just blank.
So this is the script that I am using to do the work.
<?php
//This document is called rtf-builder.php,
//and it will move form variables into an rtf file.
//Bear with me, I'm just getting into PHP
//create shortened names for variables passed from survey-builder-1 form.
$field1 = $POST['field1'];
$field2 = $POST['field2'];
$field3 = $POST['field3'];
//generate headers to help browser choose application
header( 'Content-Type: application/msword' );
header( 'Content-Disposition: inline, filename=teacher-survey.rtf' );
//suggested file name when saving
//open template file
$filename = 'template.rtf';
$output = file_get_contents($filename);
//replace place holders in RTF file with our variables
$output = str_replace( '<<FIELD1>>', $field1, $output );
$output = str_replace( '<<FIELD2>>', $field2, $output );
$output = str_replace( '<<FIELD3>>', $field3, $output );
//view output in browser
echo $output;
?>
So, in doing this, I have the user input coming from checkboxes. Each checkbox is a particular paragraph of text. This paragraph should also be in the "value" attribute right? I'm doing the HTML like this:
<form action="rtf-builder.php" method="post">
<p>Please choose the items you want to include:</p>
<ol>
<li><input type="checkbox" name="field1" value="What was your purpose for requesting today’s presentation?" />
What was your purpose for requesting today’s presentation?</li>
<li><input type="checkbox" name="field2" value="To what degree was your purpose met?" />
To what degree was your purpose met?</li>
<li><input type="checkbox" name="field3" value="Please explain your rating." />
Please explain your rating.</li>
</ol>
<p align="center"><input type="submit"></p>
</form>
Thanks for any help with my (likely rudimentary) problems.
BTW: This is for an educational, nonprofit project in the U.S.
Thanks -- Chris