Welcome to WebmasterWorld Guest from 54.147.220.66

Forum Moderators: incrediBILL

Message Too Old, No Replies

Using include files in .htm pages

   
7:04 pm on Sep 14, 2010 (gmt 0)



Hi there,

I was just wondering if anyone could advise of any server modifications I need to make in order to use .inc files in my HTML pages. If this is not possible, I would be ever so grateful if anyone could suggest an alternative method that achieves the same results as using include files in .htm pages.

Thanks in advance for your help.

Cubix
11:40 pm on Sep 14, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For starters you need to tell us what sort of web server you are using.
4:57 pm on Sep 15, 2010 (gmt 0)



Hi Dijkgraaf,

My site is hosted on a Linux server. If you need any further info, please let me know.

Thanks for your help,

Cubix
4:49 pm on Sep 16, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



in order to use .inc files in my HTML pages.


If an include is all you need, you should be able to use SSI, this is what it's for. Server Side Includes usually require an .shtml extension to tell the server to parse the file for directives.

If you don't want to rename the extensions, you can add a handler to tell the server to parse .htm and .html files as SSI.

The second way is to use PHP and include the files via PHP includes. PHP is a robust programming language and IMO is overkill for simple includes.