Why does my PHP appear to be commented out when I view it in the browser? <!--?php include(“header.php”); ?-->

前端 未结 5 732
感情败类
感情败类 2020-12-21 15:26

I am building a html page but want to break the header out so I dont have to keep changing all the files.

I am attempting to add a php.include file and save the pag

5条回答
  •  长情又很酷
    2020-12-21 16:12

    You need to check if html page can run the php code or not.
    If you are using Apache server for running html page, then the way to execute PHP on a .html page is to modify your .htaccess file. Put following code in .htaccess file:

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

    For more details, read following link : http://php.about.com/od/advancedphp/p/html_php.htm

    Another possible reason can be : File is not available on the given location , so for that check the error_log.

提交回复
热议问题