Results 1 to 6 of 6
  1. #1
    Full Member
    Join Date
    January 18th, 2005
    Posts
    396
    html question - my brain left on vacation
    I have a stupid question RE: HTML but my brain has gone far, far away on vacation.

    I have 2 html files - file_main.html and file_extra.htm. I want to add to file_main.html some syntax that 'includes' the file_extra.html at a spot down in the file_main ie:

    file_main
    ...
    ,,,
    <body>
    ...
    ...
    ...
    ...
    include file_extra.htm <right here>
    ...
    ...
    ...
    back to file_main
    ...
    ...
    </body>


    Thoughts???

  2. #2
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    <!--#include file="file_extra.htm" -->

    There are a couple of statements you may need to add to your html file also to be sure you don't need to change your pages to .shtml I'll see if I can dig those up also.
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  3. #3
    Moderator BurgerBoy's Avatar
    Join Date
    January 18th, 2005
    Location
    jacked by sylon www.sylonddos.weebly.com
    Posts
    9,618
    you can also use a php include.

    <?php include_once('file_extra.html'); ?>
    Last edited by BurgerBoy; September 4th, 2010 at 06:49 PM.

    Vietnam Veteran 1966-1970 USASA
    ABW Forum Rules - Advertise At ABW

  4. #4
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    Quote Originally Posted by BurgerBoy View Post
    you can also use a php include.

    <?php include_once('file_extra.html'); ?>
    Can you only do that on .php pages? Or is there a command to put in .htaccess for that too? I was never sure about that.
    Deborah Carney
    TeamLoxly.com BookGoodies.com ABCsPlus.com

  5. #5
    ABW Ambassador 2busy's Avatar
    Join Date
    January 17th, 2005
    Location
    Tropical Mountaintop
    Posts
    5,636
    I use php includes on html pages for navigation, footers and some coupons. There is an entry in .htaccess that lets you run php pages as html via AddHandler.

    RemoveHandler .html .htm
    AddType application/x-httpd-php .php .html


    Details are at askapache.com/htaccess
    Last edited by 2busy; September 4th, 2010 at 09:35 PM. Reason: looked it up to add it here

  6. #6
    http and a telephoto
    Join Date
    January 18th, 2005
    Location
    NYC
    Posts
    17,708
    Thanks! I knew the commands for SSI, good to know the php ones too

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Admin's brain on vacation
    By KMartin in forum Commission Junction - CJ
    Replies: 4
    Last Post: August 18th, 2005, 08:41 AM
  2. HTML Question
    By Doug247 in forum Midnight Cafe'
    Replies: 1
    Last Post: July 23rd, 2004, 10:48 PM
  3. A strange left-brain/right-brain experiment
    By Mike O in forum Midnight Cafe'
    Replies: 8
    Last Post: March 7th, 2004, 06:10 PM

Posting Permissions

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