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

前端 未结 5 726
感情败类
感情败类 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:57

    when i inspect the element using chrome the php seems to be commented out

    The PHP is not passing through a PHP parser before getting to the browser, so the browser is receiving the PHP code instead of the server executing it.

    Make sure that:

    • You are loading the page over HTTP (e.g. not just double clicking the file in your file manager)
    • The server you are using supports PHP
    • The server is configured to treat the file as PHP (this is usually done by giving it a .php file extension)

提交回复
热议问题