Jump to content

Recommended Posts

Posted

There are various ways to do that...

 

PHP (requires .php extension, and path is relative to location of page on the file system):

<?php

include("includedir/header.html");

?>

 

Server Side Includes (require .shtml extension)

Virtual (path a browser uses to access file):

<!--#include virtual="/includedir/header.html"-->

 

Those are just a couple ways.

 

You can do a google search for php include or server side includes for more detail info. Or ask here.

 

Hope that helps.

Posted

Another option is to leave your files named .htm or .html and add the following lines to your .htaccess file which tells the server to check for PHP code even if the file does not end in .php

 

AddType application/x-httpd-php .htm

AddType application/x-httpd-php .html

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...