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

后端 未结 12 2289
栀梦
栀梦 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 23:01

    Create an empty file using notepad and name it .htaccess ,Then copy that file in your project directory and add this line and save.

    AddType application/x-httpd-php .htm .html
    

    else save the .html file using .php as php can support html,and save it in computer/var/www/html path(linux)

提交回复
热议问题