Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

tranche

(929 posts)
7. If you have access to an .htaccess file or your httpd.conf file:
Tue Dec 13, 2011, 04:43 PM
Dec 2011

You can add something like this:

AddType application/x-httpd-php .shtml

Basically, you can indeed execute PHP code in just about any filetype if you specify it.

http://stackoverflow.com/questions/1581765/can-we-include-php-file-in-html-file
http://stackoverflow.com/questions/1672391/html-php-do-i-need-to-change-the-extension-of-html-file

or you could just have your PHP script spit out a .shtml (.inc) file and include that in your index.shtml file.

Recommendations

0 members have recommended this reply (displayed in chronological order):

Latest Discussions»Retired Forums»Website, DB, & Software Developers»Do PHP files need a certa...»Reply #7