Originally posted by izann
This sounds logical; however, I have no idea how to do it. The only thing I can find in the PHP manual is cpdf_output_buffer.
Hi Izann, I built this onto hand's snippet. It usually works for me.
$filename = "http://localhost/path/to/your/script/friend.php"; // so it parses the script
@$fd = fopen($filename,"r");
while (!feof($fd)) {
$data .= fgets($fd, 4096);
}
@fclose($fd);
$MESSAGE = $data;
// ......
// New Stuff
$start_1="echo(\"".$MESSAGE;
$start2=str_replace("<?","\");",$start_1);
$start3=str_replace("?>","echo(\"",$start2);
$start3 .= "\");";
ob_start();
eval($start3);
$MESSAGE = ob_get_contents();
ob_end_clean();
And there's your data. All you have to do is echo is to the screen.
One more thing, if you get a whole whack of eval() warnings/errors, it's probably because you have double quotes (") inside your php file. Unless these are in an actual echo statement, you need to put a backslash in front of them. The other thing that eval doesn't like is <?=$variable?>. Because of the way I parse it, you can't use this. Instead use <? echo $variable; ?>. Hope this works.