Does anyone know of a way of inserting code at a "marker", such as a special HTML comment, in order to write new code to the middle of an existing document?
I have some HTML code for page content stored in a database, part of a CMS I'm about to finish that creates ezines. Because of problems with incorporating PHP code in a Javascript-based editor environment that would only render the PHP-generated code to HTML, I would like to add the PHP at the very last minute, when the user publishes the ezine. At that point, I would like to create a new document on the server, get the code
from the database, write it to the new file, find the "marker", add the new code, rewrite the file's new contents back to the database and then delete the temporary file.
Any thoughts? There's bound to be an easier way to do this, but I'm struggling to find it...
Thanks in advance