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

前端 未结 5 716
感情败类
感情败类 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 15:53

    OK. A few things.

    1. Check that your file is actually being interpreted as PHP rather than just bog-standard HTML.
    2. Turn on all your error reporting (error_reporting = E_ALL | E_STRICT | E_WARNING in php.ini)
    3. Make sure your errors are displayed (display_errors = on in php.ini)

    Try using require rather than include as require will halt execution if it can't load the file and show an error

提交回复
热议问题