what's wrong with this include statement that i did in php? [closed]

扶醉桌前 提交于 2019-12-04 07:11:19

问题


<?php

    include("articles/article_6.html");
?>

i wanted the article to be posted on my website but it gives the error:

Parse error: syntax error, unexpected 'version' (T_STRING) in /opt/lampp/htdocs/white_coats/articles/article_6.html on line 1


回答1:


article_6.html has no php tags. its just a word file that was saved in .html so that it could be displayed on the website. it's just an article with some pictures.

Then you don't include it. You read it's contents and print em. Include statements are nearly always for code includes and not plain html or text content.

echo file_get_contents("articles/article_6.html");


来源:https://stackoverflow.com/questions/27641432/whats-wrong-with-this-include-statement-that-i-did-in-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!