I have a working templete system for my current project but what I want to do is read a php file in for it is displayed so I can replace some tags I.e <% FORM1 %> then display the fill PHP page.
now I have it replacing the tags put when it goes to display the page all I see is code and looking at the pages source via mozilla the <?php and the first few parts of the code are a pink colour
I am thinking its because I am turning it into a string but I am not sure here is my code so far.
Code: Select all
$phphtml = "";
if ($FH = fopen($page_url, 'r')){
$phphtml = fread($FH, filesize($page_url));
fclose($FH);
}
$phphtml = str_replace( "<% FORM1 %>", "blah", $phphtml );
print $phphtml;