apache question
Results 1 to 5 of 5

Thread: apache question

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    214

    apache question

    Hello,
    I'm wondering if there's a way in apache to dynamically prepend a text or html file to a html file being served in a specific directory. In other words, in /stuff, all files requested would automatically have the file foo.htm prepended to that document. I hope I made that clear.

    Is there a way to do that without editing each file? (like an apache config directive or such) and besides SSI...?
    Either get busy living or get busy dying.

    -The Sawshank Redemption

  2. #2
    Kwiep
    Join Date
    Aug 2001
    Posts
    924
    Id hope I understood it correctly, but there is some piece of javascript or maybe html even that let's you insert another pages code... I don't remember, but it was something with <insert or <include ... I have to look that up a bit.
    Double Dutch

  3. #3
    Hi mom!
    Join Date
    Aug 2001
    Posts
    1,103
    I think neel is takling about the PHP include() function. That would work, but you have to edit all files in that directory to include this line:
    PHP Code:
    <?php include("foo.php"?>
    I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.

  4. #4
    Kwiep
    Join Date
    Aug 2001
    Posts
    924
    Yeah php has that, but I thought he was talking about html... I thought there was something similar in javascript, I only don't remember because I don't use javascript anymore for the things that php can do for me.
    Double Dutch

  5. #5
    Senior Member
    Join Date
    Jul 2002
    Posts
    339
    For html solution, see some examples of dynamic html using javascript in http://www.dynamicdrive.com/dynamicindex17/index.html
    to get some ideas. Specifically learn about the src property of an iframe.

    But again, yes, this means editing each file to insert some codes. The original question was asking how to do it w/o editing each file by utilizing apache directive or such. Oh well, i'm not aware of any other way. Sorry.

    Peace always,
    <jdenny>
    Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
    I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •