Re: Automatic Headers and Footers
| From: | Mark | Date: | Thu, 05 Jun 2003 20:40:20 +0000 |
| Subject: | Re: Automatic Headers and Footers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150409@lists.php.net to get a copy of this message | ||
Well, my understanding of mod_rewrite is nonexistent (heck, I'm not
even sure that's the correct name), but I believe you do the
following. Write a php script to parse the file and output it with
the added lines you want where you want them. Then setup apache/php
to accept something like
http://www.yourserver.com/directory/phpscript/yourfile.html
where <directory> is the path to where the files are located,
<phpscript> is the php script (located (in <directory>)that parses
the html files, and <yourfile.html> is... one of your HTML files.
It's not ideal, but it will let you wrap something around existing
HTML files without modifying them or their location.
--- Wendell Brown <wbrown@arkie.net> wrote:
> 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!!!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
=====
Mark Weinstock
mark_weinstock@yahoo.com
***************************************
You can't demand something as a "right" unless you are willing to fight to death to
defend everyone else's right to the same thing.
***************************************
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com