How do I add PHP code/file to HTML(.html) files?

后端 未结 12 2329
栀梦
栀梦 2020-11-21 22:05

I can\'t use PHP in my HTML pages. For example, index.html. I\'ve tried using both:

 

and



        
12条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-21 22:56

    By default you can't use PHP in HTML pages.

    To do that, modify your .htacccess file with the following:

    AddType application/x-httpd-php .html
    

提交回复
热议问题