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
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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.