Hello people
I am posting a question about something that is really puzzling to me.
I am using the [B][COLOR=”Red”]exact same code [COLOR=”red”][B]It only works on the first page
What am I doing wrong?
I send variables ([B]D1, D2, D3,…[B]D1P,D2P,D3P,…
My code works perfectly in one page but as I mentioned I repeat the same procedure with the exact same code (just different file name) and the second page does not work. [COLOR=”red”][B]The page opens but variables do not get replaced.
The code is as:
[code=php][/[COLOR=”RoyalBlue”]<?php
header( “Content-Type: application/msword” );
header( “Content-Disposition: inline, filename=GeneralDes.rtf”);
// open our template file
$filename = “T_TD.rtf”;
$fp = fopen ( $filename, “r” );
//read our template into a variable
$output = fread( $fp, filesize( $filename2 ) );
//REPLACING THE ITEMS
$D1=’aaaa’;
$D2=’bbbb’;
$D3=’cccc’;
$output=str_replace(“<<D1P>>”,$D1,$output);
$output=str_replace(“<<D2P>>”,$D2,$output);
$output=str_replace(“<<D3P>>”,$D3,$output);
echo $output;
fclose ( $fp );
?>[/COLOR]PHP]