> Ok here's the deal, I cut out the middle man, went straight 
> to the script, assigned my variable a string, and loaded the 
> rtf page, NADA, ZIP, ZILCH!!

At least as far as this test is concerned, I hope you have a nice soft desk
to bang your head on.  Check your assignment operator one more time.

> <?php
> //print_r($_POST);
> //$na = $_GET['f'];
> ---->$na == "Me";

If your script has the same "==" where a plain ol' "=" should be, that'd
account for the replacement being empty (since it's replaced with $na, which
wasn't assigned).

As far as the original troubles you're trying to diagnose, I loosely
replicated your setup and everything worked as expected. (I just made up a
Lettertest.rtf file.)  Below are the working files, see if they work for
you:

Cheers,

Rick

Form.html:
=========================================
<HTML>
<BODY>
<FORM action="rtf1.php" method="POST">
<INPUT type="text" name="fname">
<INPUT type="submit" value="Test">
</FORM>
</BODY>
</HTML>
=========================================

rtf1.php:
=========================================
<?php
$name = $_POST['fname'];

$filename = "Lettertest.rtf";

header( 'Content-Type: application/msword' );
header('Content-Disposition: inline, "rtftest.rtf"');

$fp = fopen( $filename, "r" );

$output = fread( $fp, filesize( $filename ) );

$output = str_replace( '<<FNAME>>', $name, $output );

echo $output;
?>
=========================================

Lettertest.rtf:
=========================================
a line of test
Hello, <<FNAME>>
another line
=========================================

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to