If only to avoid duplicating code / redirects, I don't want to write an xhtml for original entry and duplicate it with embedded <?php ?> tags should I need to resend it.
(e.g. index.html containing a form that I need to send back with error messages).
What I've come up with works nicely, but I wonder if it would qualify as Best Practices.
Here's an example. In my HTML I position my substitute candidate as a comment.
<p id="msg"><!-- anymsg --></p>
This way I can use the .html suffix and browsers will honor it.
Now (in this example) I find an error, I simply (1) download the original html via PHP function 'implode' and (2) replace the '<!-- anymsg -->' string with my html-formatted error message(s) based on the PHP function substr_replace.
Is that a recognizable way to do it, or is there a more common approach?