what's wrong with this include statement that

2019-03-07 05:15发布

<?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条回答
一夜七次
2楼-- · 2019-03-07 05:36

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");
查看更多
登录 后发表回答