Hello
I want to create NON dinamic pages (php with mysql querries) because my site has a high n?of daily visits and dont't want to kill mysql with many queries and safe some bandwidth.
My idea was to create and execute an small script that would create in a folder a list of PERMANENT pages with the mysql querries already done... and update those files created often executing that script back.
I have been playing with fwrite() function and get the first problems when executing this small code:
// In from.php I have: <? echo "hello man"; ?>
<?
$filename = "from.php";
$fd = fopen ($filename, "r");
$fd2 = fopen("to.php","w");
$contents = fread ($fd, filesize ($filename));
fwrite($fd2,$contents);
fclose ($fd);
fclose ($fd2);
?>
My question is:
why is not copied to to.php the phrase "hello man" instead of the php code <? echo "hello man"; ?> ?
How could I make the php code appear already executed instead with the tags...?
thanks for any help
I want to create NON dinamic pages (php with mysql querries) because my site has a high n?of daily visits and dont't want to kill mysql with many queries and safe some bandwidth.
My idea was to create and execute an small script that would create in a folder a list of PERMANENT pages with the mysql querries already done... and update those files created often executing that script back.
I have been playing with fwrite() function and get the first problems when executing this small code:
// In from.php I have: <? echo "hello man"; ?>
<?
$filename = "from.php";
$fd = fopen ($filename, "r");
$fd2 = fopen("to.php","w");
$contents = fread ($fd, filesize ($filename));
fwrite($fd2,$contents);
fclose ($fd);
fclose ($fd2);
?>
My question is:
why is not copied to to.php the phrase "hello man" instead of the php code <? echo "hello man"; ?> ?
How could I make the php code appear already executed instead with the tags...?
thanks for any help