I want to include a PHP file in an SHTML file and store the result in a SHTML variable and include different things depending on the result.
Example:
Assume the PHP
Let's say you have a template.shtml file with the text @@PHPVARHERE@@ somewhere in it.
The user calls script.php?var=1. Not the script loads the contents of the template.shtml file (file_get_contents) and does a str_replace to replace @@PHPVARHERE@@ with $_REQUEST['var'] (in this case 1).
Then the script outputs all of this to file1.shtml. If the file already existed use the existing file or overwrite it - whatever happens to be right in this situation.
So the script dynamically creates the relevant shtml-files on the fly at runtime. Just add a Header('Relocate: file1.shtml'); and the script redirects the browser to the generated file.
This is the nearest you can get from what I understood.