PHP - 我如何进行自己的人工验证?
我想制作自己的 php 脚本来进行人工验证。就像一系列简单的数字/字母(验证码)一样,没什么特别的。
建议?尖端?需要注意什么?
I'd like to make my own php script for the human verification . Like an easy series of numbers/letters (captcha), nothing special.
Suggestion? Tips? Things to keep in mind?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用验证码服务(例如 recaptcha)来检查是否有人。
或者使用图像库创建自己的图像并将答案存储在数据库中,并为图像文件的名称指定一些无法追溯到单词的名称,您可能需要使单词变得模糊,因为机器人可以使用 ocr。
我看到的另一种新颖方法是有人使用 ascii 艺术验证码,如下所示
http://www.network-science。 de/ascii/
You could use a captcha service such as recaptcha to check for a human.
Or create your own using an image library and storing the answers in a database and giving the names of the image file something that cannot be traced back to the word, you might need to make the words fuzzy as bot can use ocr.
another novel approach i saw was someone using an ascii art captcha like this
http://www.network-science.de/ascii/
通过简单的谷歌搜索就可以广泛涵盖这个问题。
您可以使用此教程示例作为参考:
this issue is widely covered by a simple google search.
you can use this tutorial example for a reference:
我保留一个问题列表及其相关的答案服务器端。当为带有问题的表单生成 HTML 时,我将随机选择的问题添加到表单中,并将问题的索引(来自问题列表)存储在用户会话中。然后,当发布答案时,我可以简单地使用会话中的索引检查答案。
值得牢记的是:
还值得思考“我们为什么要问这个?”表格上的一些信息,因为一些用户可能对为什么会出现这个问题感到有点困惑。
I keep a list of questions and their associated answer server side. When generating the HTML for a form with a question I add the randomly selected question to the form and store the index of the question (from the list of questions) in the user's session. Then, when answer is posted I can simply check the answer with the index from the session.
Worth baring in mind that:
Also worth having a "why are we asking this?" bit on the form as some users may be a bit confused as to why the question is there.
您可以使用 GD 库来完成此任务。如何在此处完成此操作的示例: http: //www.php-help.ro/php-tutorials/simple-php-gd-capcha-image/
You can use the GD library to accomplish this. An example of how it can be done here: http://www.php-help.ro/php-tutorials/simple-php-gd-capcha-image/