Hello
Im doing a program, but I need to create an html document that have results of php code.
Example:
I have a file that name is: copy.inc
In this file I have that code:
============ copy.inc =============
<?php
for ($i=1; $i<=9; $i++) {
echo "Hello<br>\n";
}
?>
And I want to copy the code that copy.inc have to another file named: copy.html
Here is how I copy the code:
I have another file named: copy.php
============ copy.php =============
<?php
$file = fopen("copy.inc","r");
$source = fread($file,1000000);
fclose($thefile);
$copy = fopen("copy.html","w");
fwrite($copy,$source);
fclose($copy);
}
?>
But when I do that, in copy.html copy the full php code, not copy the html interpreted code, how can I do to interpret the php code of copy.inc to html code before copy the code of copy.inc to copy.html?
I need that in copy.html the source be:
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
Hello<br>
no this code:
<?php
for ($i=1; $i<=9; $i++) {
echo "Hello<br>\n";
}
?>
If you know that please reply me!
Thanks
Jacobo