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

后端 未结 12 2099
栀梦
栀梦 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:53

    In order to use php in .html files, you must associate them with your PHP processor in your HTTP server's config file. In Apache, that looks like this:

    AddHandler application/x-httpd-php .html
    

提交回复
热议问题