PHP / MySQL:如何在您的网站中创建评论部分 [英] PHP/MySQL: How to create a comment section in your website

查看:134
本文介绍了PHP / MySQL:如何在您的网站中创建评论部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而不是询问如何使用PHP / MySQL让用户影响网页,我会问这个,因为我从项目和示例中学到更多。

Instead of asking 'how to use PHP/MySQL to let users affect webpages' I'll ask this, because I learn better from projects and examples.

我如何将使用PHP和MySQL的一个非常基本的注释功能?

So how would I incorporate a VERY basic comment feature using PHP and MySQL?

推荐答案

这是一个很难回答的问题,没有更多的信息。

It's a hard question to answer without more information. There are a number of things you should consider when looking at implementing commenting on an existing website.

您将如何解决垃圾邮件的问题?无论你的网站多么遥远,垃圾邮件发送者会发现它,他们会立即填补它。您可能想查看类似reCAPTCHA( http://recaptcha.net/ )。

How will you address the issue of spam? It doesn't matter how remote your website is, spammers WILL find it and they'll filled it up in no time. You may want to look into something like reCAPTCHA (http://recaptcha.net/).

网站的结构也可能影响您实现评论的方式。是针对整个网站,特定产品或网页的评论,还是其他评论?您需要知道内容和注释之间的关系,以便可以在数据库中正确定义关系。换句话说,你知道你想要一个电子邮件地址,评论,以及它是否被批准,但现在我们需要一种方法来确定评论是否链接到什么。

The structure of the website may also influence how you implement your comments. Are the comments for the overall site, a particular product or page, or even another comment? You'll need to know the relationship between the content and the comment so you can properly define the relationship in the database. To put it another way, you know you want an email address, the comment, and whether it is approved or not, but now we need a way to identify what, if anything, the comment is linked to.

如果您的网站已建立并建立在PHP框架上( CakePHP ) )您需要解决如何将您的代码与已有的代码正确集成。

If your site is already established and built on a PHP framework (CakePHP for instance) you'll need to address how to integrate your code properly with what is already in place.

最后,有一些资源和教程在网上为PHP 。如果你快速google搜索一些沿着PHP博客教程的话,我相信你会发现几百,大多数会告诉你一步一步如何实现评论。

Lastly, there are a number of resources and tutorials on the web for PHP. If you do a quick google search for something along the lines of "PHP blog tutorial" I'm sure you'll find hundreds and the majority will show you step by step how to implement comments.

这篇关于PHP / MySQL:如何在您的网站中创建评论部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆