The Little Guy Posted September 8, 2009 Share Posted September 8, 2009 How can I add a handler to html files so I can place: <?php echo "hello"; ?> in an html file? Everything I try to my htaccess file, opens a download box to download the file, such as: AddHandler x-httpd-php html Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/ Share on other sites More sharing options...
TeNDoLLA Posted September 8, 2009 Share Posted September 8, 2009 How bout adding this to the .htaccess file? AddType application/x-httpd-php .html Or if that does not work how bout this? RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/#findComment-914939 Share on other sites More sharing options...
The Little Guy Posted September 8, 2009 Author Share Posted September 8, 2009 Nope, that still gives me the download window... Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/#findComment-914941 Share on other sites More sharing options...
Alex Posted September 8, 2009 Share Posted September 8, 2009 try: <Files "somefile.html"> AddType application/x-httpd-php .html </Files> If that doesn't work you'll have to change some other configuration. Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/#findComment-914944 Share on other sites More sharing options...
The Little Guy Posted September 8, 2009 Author Share Posted September 8, 2009 try: <Files "somefile.html"> AddType application/x-httpd-php .html </Files> If that doesn't work you'll have to change some other configuration. Nope, that doesn't work either... Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/#findComment-914946 Share on other sites More sharing options...
The Little Guy Posted September 8, 2009 Author Share Posted September 8, 2009 Got it! AddHandler php5-cgi .php .htm .html Quote Link to comment https://forums.phpfreaks.com/topic/173577-solved-html-as-php/#findComment-914951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.