vwinstead Posted February 4, 2009 Share Posted February 4, 2009 Newbie question: I have index.html as my main site file. Can I use php within that file? Or do I NEED to run php only within a php file? Link to comment https://forums.phpfreaks.com/topic/143777-newbie-question-running-php-from-html-files/ Share on other sites More sharing options...
nadeemshafi9 Posted February 4, 2009 Share Posted February 4, 2009 Newbie question: I have index.html as my main site file. Can I use php within that file? Or do I NEED to run php only within a php file? there may be soem way to use php on that file by changing the web servers config to parse all html files wihc would be silly better off rename teh file .php Link to comment https://forums.phpfreaks.com/topic/143777-newbie-question-running-php-from-html-files/#findComment-754332 Share on other sites More sharing options...
gevans Posted February 4, 2009 Share Posted February 4, 2009 If you're using Apache and have access to your httpd.conf file look for the line; AddType application/x-httpd-php .php It may have other extensions as well, to enable .html files to be parsed as php add the following AddType application/x-httpd-php .php .html Link to comment https://forums.phpfreaks.com/topic/143777-newbie-question-running-php-from-html-files/#findComment-754339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.