我对创建一个允许用户提交内容并将其显示在新页面上以供其他用户查看的网站的想法感兴趣。例如,有一个带有几个文本字段需要填写的表单,这将是共享的信息。我看过一些 CMS 软件,其中大部分都无法满足我的需要。因此,如果您有任何建议或文档可以引导我走向正确的方向,那就太好了。
I am interested in the idea of creating a website that allows users to submit content and display it on new pages for other users to view. For example having a form with a few text fields to fill out, and this will be the information that is shared. I have looked at some CMS software and most of it is too much for what i need. So if you have any advice or documentation to lead me in the right direction that would be wonderful.
发布评论
评论(4)
任何关于 MySQL 和 PHP 应用程序开发的书籍都将包含完全符合您所描述的示例 - 我建议您购买一本并开始您的冒险!
如果您接受挑战并且不使用现有代码,那么您首先需要了解的一件事是:
在任何情况下,请 100% 确保用户输入的值不会被解释为SQL 代码。如果用户滥用您的表单并且您没有采取先发制人的措施,SQL 注入是一种获取整个数据库的访问权限或从中删除数据的简单方法。只需对来自用户表单的每个变量调用 mysql_real_escape_string() 即可防止这种情况发生。
有关详细信息,请查看 http://en.wikipedia.org/wiki/SQL_injection。
祝你好运!
Any book on MySQL and PHP application development will contain examples that do exactly what you describe -- I suggest you buy one and get started on your adventure!
If you take up the challenge and not use existing code, one thing you'll want to know up front is this:
In any case, make 100% sure that the values users enter can not be interpreted as SQL code. If users abuse your forms and you don't take preemptive measures, SQL injection is an easy way of gaining access to the entire database or deleting data from it. Simply calling mysql_real_escape_string() on every variable that comes from the user form, will prevent this from being possible.
Check http://en.wikipedia.org/wiki/SQL_injection for more info on this.
Good luck!
寻找轻量级CMS重新发明轮子并不明智
look for lightweight CMS it not wise to reinventing the wheel
你可以使用留言簿源代码,它可以完成你所要做的就是添加一些 html
you can use a guest book source code it can do the job all you have to do is to add some html
虽然许多 CMS 软件包可能超出您的需要,但学习 CMS 很可能仍然比弄清楚如何自己完成所有事情更容易。
也就是说,弄清楚如何自己做是学习 Web 开发基础知识的更好方法。一个流行的起点是在 PHP ="nofollow">Apache 和 MySQL 数据库。如果您使用的是 Windows,您可以找到将所有这些东西安装在一起的软件包,并让您免于进行大量低级配置,例如 WAMP。
While many CMS packages probably have more than you need, it will most likely still be easier to learn a CMS than to figure out how to do everything on your own.
That said, figuring out how to do it yourself is a much better way to learn the fundamentals of web development. A popular place to start is PHP running on Apache with a MySQL database. If you're on Windows, you can find packages that install all of those things together and saves you from a lot of the low level configuration, for example WAMP.