Read the contents of the template file, and store it in variable.
Then, perform a replace to replace a tag with whatever you want (page content for example).
Then I believe there’s a EVAL command, where you pass PHP/HTML to it, and it’ll actually executes the code within it, then finally, you need to echo the output. http://php.net/manual/en/function.eval.php
If however you’re just putting HTML into the template, then a simple, load the template, str_replace() what you need to, and echo out the contents.
i.e.
$template = ‘<h1>Welcome to my site</h1><div>{content}</div>’;
$inner_content = ‘<p>Some other text in here</p>’;
echo str_replace(“{content}”,$inner_content,$template);
or, if there is PHP in the $inner_content, something like
echo eval(“?>” . str_replace(“{content}”,$inner_content,$template) . “<?php”);
I have a template file named “Artistlist” and there’s are couple of meta tags which I need to replace with actual. [TITLE] etc
ArtistList queries Data model and fetches the list with full HTML markup but Meta tags needs to be actual ones which must relate to Artist List for example.
include"artlist.php"; << this is printing the content I want the content in a variable as string.
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
* Please contact the website owners to inform them of this problem.
ob_start(“ob_gzhandler”); compresses the output with gzip.
Either the whole page needs to compressed using gzip and the appropriate headers sent, or none of it must be compressed.
In your case you only compressed only part of the page, and that doesn’t work