homepage Welcome to WebmasterWorld Guest from 54.83.133.189
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Calling external php in htm files
Is this possible?
GGR_Web




msg:3821804
 11:09 am on Jan 8, 2009 (gmt 0)

The site I maintain uses htm files. I've heard these won't run php scripts and dreamweaver certainly throws a wobbly if I attempt to use a <?php?> tag.
Is it possible to use php in htm?
Is it possible to convert htm to html?

 

phranque




msg:3821830
 12:48 pm on Jan 8, 2009 (gmt 0)

assuming apache, you can use the AddHandler directive of the mod_mime module:
AddHandler Directive - mod_mime - Apache HTTP Server [httpd.apache.org]

something like this might work:
AddHandler php5-script .html

quartzy




msg:3823764
 2:04 am on Jan 11, 2009 (gmt 0)

HTML files and htm files can run php scripts, with the php tags.And you can just change the file name to reflect htm or html. Is this what you wanted to know?

ncw164x




msg:3823773
 3:16 am on Jan 11, 2009 (gmt 0)

you can use a php include file, make a file called text.php (or what ever name you choose) containing whatever you want to include on the web page and upload to your web space, copy and paste the code below to where you want the included code to appear on your web page. it requires the full server path to text.php

<?
include ("/full server path to your file/text.php");
?>

---------------------------------------

converting htm to html using .htaccess file

using notepad copy the code below and save as htaccess, upload to your web space and rename as .htaccess

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.html [NC]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved