在哪里存储html页面更好


Where is better to store html pages?

在数据库中还是在文件本身中存储html页面更好?

如果我有很多文件:

用户/login。用户/register.php

用户/somethingElse.php

文章/index . php

文章/view.php

文章/somethingElse.php

和所有代码都存储在那里,还是将这些页面作为HTML存储在数据库中,然后仅将其呈现为一个文件content.php?

我可以说将HTML存储到文件中比存储到数据库中要好得多,因为

1)For retrieving data also you need to perform DB operations as well,so it may stuck DB somewhere when load is become a 'real load' to operate DB
2)A DB can crash but a file cont much when compared to DB
3)If you want to change the HTML you need to perform agian update operation for that which makes big issue for an developer to work 
4)And also in DB you need to store HTML tags,other things using 'htmlentities' which causes conflict  

您可以将HTML代码存储在PHP文件中,也可以使用HTML文件并让PHP获取这些文件

我喜欢这样做的方式是在我的root:/index.php-file中尽可能多地保留HTML,然后根据用户想要看到的页面加载我需要的文件。

F.x。用户想看我发送到index。php的文章吗?Page =articles,加载页面布局并包含("articles/index.php");这也可以让你使用htaccess使url看起来更好。

但作为一般规则,不要在SQL中保留html代码,除非它是用户提交的东西