Automatic Headers and Footers
| From: | Wendell Brown | Date: | Thu, 05 Jun 2003 20:33:05 +0000 |
| Subject: | Automatic Headers and Footers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150406@lists.php.net to get a copy of this message | ||
Ok guys, I think I have a challenge for you (actually, I don't think
this can be done, but I've been proven wrong every time I've made that
assumption with php in the past, so I'll ask anyway). Here's the
question:
Is there a way to have php insert headers and/or footers into all of
the html files in a given directory on the fly (not actually modifying
the files)? And by this I mean take an existing valid HTML file and
add headers and footers and end up with a valid HTML file.
Now, before some of you get trigger happy and tell me to read the
manual and point me to things like .htaccess, auto_prepend_file, google
and the like, think about what I'm really asking.... It needs to
insert the header after the -body- tag and put the footer in before the
-/body- tag. It needs to do this without modifications to the HTML
file.
And yes, I understand that by default HTML files aren't going to be
effected by the auto_prepend_file (since they aren't php files) - so it
will require adding HTML to the list of php parsed file types.
For instance, the goal would be to take the following code:
-HTML-
-Head-
-Title-This is a test-Title-
-body-
Well, did it work?
-/body-
-/html-
and convert it to this:
-HTML-
-Head-
-Title-This is a test-Title-
-body-
-h1-This is a page header-/h1-
Well, did it work?
-h3-This is the footer-/h3-
-/body-
-/html-
Can it be done? I don't think so, but I leave it up to your wiles to
suggest a solution....
Thanks!!!