POST [] ing附加值 [英] POST[]ing Extra Values

查看:111
本文介绍了POST [] ing附加值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个自定义的验证码,在其中生成随机数,您必须将它们加在一起等等.截至目前,我正在回显这些随机数,但是现在我需要将它们拉到一个外部文件中以测试总和针对输入文本.我可以在提交表单时将它们添加到POST []数组中吗?

I am creating a custom captcha where random numbers are generated and you have to add them together etc. As of right now I am echo-ing these random numbers but now I need to pull them into a external file to test the sum against the input text. Can I add these to the POST[] array on form submission?

推荐答案

您必须具有某种方式来跟踪数字,并在以后取回它们以进行验证.您可以使用会话变量-在页面加载时将数字放入,然后在表单过帐时再次输入,并进行相互检查.

You have to have some way of keeping track of the numbers and retrieving them back later for verification. You could use session variables- put the numbers in at the time of the page load, and then again when the form is POST'd and check them against each other.

此外,请记住,任何试图欺骗此过程的人都可以轻松查看表单上或$ _POST中的内容.将它们放在会话变量中会使某人更难查看要检查其数字的内容.

Also, keep in mind anything on the form or that is put in $_POST can be easily viewed by anyone attempting to fool this process. Putting them in session variables makes it much harder for someone to view the contents of what their numbers will be checked against.

这篇关于POST [] ing附加值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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