开发者

Store website not in database but in HTML

Could you recommend me a nice technology for my problem? I had a blog and now it as a 开发者_JAVA技巧classical dynamic page MySql + Php + Javascript. But i would rewrite it. If an user event happend, i.e. a user posted a comment, i wouldn't store it in database, but store the changes in an HTML file. So the logic is not in the php file but in html file. How can i do that, but in an easy way.


You could theoretically parse the static html file after a user event (i.e.: POST) and append the result to the html, write back to the file, however I wouldn't recommend it as the script would have to be fairly complex to handle the html correctly.


If you want to edit static HTML files when the user posts a comment than it is a bad approach IMHO. How would you implement searching, for example?

Don't try replicating what database is doing, because the guys that wrote database spend their whole lives doing just that.

You might want to search for existing blog solutions instead of writing one from scratch. There are many open-source projects written in many languages / platforms.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜