关于允许用户向 mysql 数据库提交信息的指南

发布于 2024-10-24 07:52:31 字数 141 浏览 5 评论 0 原文

我对创建一个允许用户提交内容并将其显示在新页面上以供其他用户查看的网站的想法感兴趣。例如,有一个带有几个文本字段需要填写的表单,这将是共享的信息。我看过一些 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

看春风乍起 2024-10-31 07:52:31

任何关于 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!

少跟Wǒ拽 2024-10-31 07:52:31

寻找轻量级CMS重新发明轮子并不明智

look for lightweight CMS it not wise to reinventing the wheel

忘羡 2024-10-31 07:52:31

你可以使用留言簿源代码,它可以完成你所要做的就是添加一些 html

you can use a guest book source code it can do the job all you have to do is to add some html

茶花眉 2024-10-31 07:52:31

虽然许多 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文