Jump to content

Reading in php from another file.


the_oliver

Recommended Posts

Hi,

 

I have a script that when called will pull in content from another page using the following:

 

$page_content = str_replace("[[body]]",file_get_contents("pages/".$view.".".$stype),$page_content);
echo $page_content;

 

However if i have php code in the included file, its not exicuted.  Can any one tell me why that would be please?

 

Thanks!

 

 

Link to comment
https://forums.phpfreaks.com/topic/163280-reading-in-php-from-another-file/
Share on other sites

It seems to be placing the contents of the included file, about the rest of the output...

 

I have a template file and my snipit of php above should search through it and replace '[[body]]' with the contents of the included file.  If the file does not contain a ';' its fine!  If it does, the the included file appars at the top of the template, before the <HTML> tag.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.