xProteuSx Posted December 5, 2008 Share Posted December 5, 2008 Is there a way to include php code in an html file? What I mean, is, can I still have the .html extension, and not have to change it to a .php file? I have found that if I am working with an html file and include snippets of code in the middle, the code is treated like errant text. Thanks. Link to comment https://forums.phpfreaks.com/topic/135621-solved-including-php-in-a-html-file/ Share on other sites More sharing options...
PravinS Posted December 5, 2008 Share Posted December 5, 2008 You cannot include .php file in .html page. You can try iframe to call .php page in .html page. Link to comment https://forums.phpfreaks.com/topic/135621-solved-including-php-in-a-html-file/#findComment-706580 Share on other sites More sharing options...
beansandsausages Posted December 5, 2008 Share Posted December 5, 2008 I think you have to change the extension in the php.int file. I could be wrong though. Link to comment https://forums.phpfreaks.com/topic/135621-solved-including-php-in-a-html-file/#findComment-706581 Share on other sites More sharing options...
xProteuSx Posted December 5, 2008 Author Share Posted December 5, 2008 Actually, just had to add this to my .htaccess file: AddHandler application/x-httpd-php5 .html .php .htm This got it working. Thanks anyways. Link to comment https://forums.phpfreaks.com/topic/135621-solved-including-php-in-a-html-file/#findComment-706583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.