how to print php code using PHP File write
Posted: Fri Feb 05, 2010 2:26 pm
Hi,
I am writing a index.html file using PHP File Write method for example:
$prodout="Lot of Strings and other php variables having information";
$f2 = fopen($fullpath, "w");
fwrite($f2, $prodout);
fclose($f2);
i want to write PHP code so that it shows as php in .html file ( i have setup my server to parse .html pages as php)
for example
$prodout="Lot of Strings and other php variables having information";
$prodout.="<?php include($_SERVER[\"DOCUMENT_ROOT\"].\"/recently-viewed-items.php\"); ?>";
$f2 = fopen($fullpath, "w");
fwrite($f2, $prodout);
fclose($f2);
so when it becomes index.html it will look like
Lot of Strings and other php variables having information
<?php include($_SERVER["DOCUMENT_ROOT"]."/recently-viewed-items.php"); ?>
Any body can help how i can achieve this goal.
Thank you,
I am writing a index.html file using PHP File Write method for example:
$prodout="Lot of Strings and other php variables having information";
$f2 = fopen($fullpath, "w");
fwrite($f2, $prodout);
fclose($f2);
i want to write PHP code so that it shows as php in .html file ( i have setup my server to parse .html pages as php)
for example
$prodout="Lot of Strings and other php variables having information";
$prodout.="<?php include($_SERVER[\"DOCUMENT_ROOT\"].\"/recently-viewed-items.php\"); ?>";
$f2 = fopen($fullpath, "w");
fwrite($f2, $prodout);
fclose($f2);
so when it becomes index.html it will look like
Lot of Strings and other php variables having information
<?php include($_SERVER["DOCUMENT_ROOT"]."/recently-viewed-items.php"); ?>
Any body can help how i can achieve this goal.
Thank you,