Results 1 to 5 of 5

Thread: include....

  1. #1
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default include....

    hello eveyone.

    what is the basic code to include html pages into a web page. i wont to be able to change all my website pages at once. its something like this...

    <-include virtual......something or another->

    bascially put i want a top and bottom pages i change with the middle the " differant" web pages.

    thank you

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    There are a few ways to do this, but I use

    PHP Code:
    <?php
    include '../metastuff.php';
    ?>
    or
    PHP Code:
    <?php
    include 'http://www.mysite.com/include/header.php';
    ?>
    html stuff
    <?php
    include 'http://www.mysite.com/include/footer.php';
    ?>
    oh, and if the files to be included are php files like shown above, be sure that the content in those included files are also contained in php tags otherwise it will be read as html.

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Or if your pages are of the .shtml extension, you would use SSI to include external files:

    Code:
    <!--#include file="external.htm"-->
    
    <!--#include virtual="/external.htm"-->
    More info here: http://javascriptkit.com/howto/ssi2.shtml

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The above will also work for ASP.

    With Smarty, it's:
    Code:
    {include file='/external.tpl'}
    Django:
    Code:
    {&#37; include '/external.tpl' %}
    It really does depend on what you're using to write your site.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Sep 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you very much. that works.

Bookmarks

Posting Permissions

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